I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?

Are you trying to show the ‘featured image’? Or can you use it?
If so, there is a simple way to do it:

Add this line of code in your theme’s functions.php file, or be sure that it has this:

add_theme_support( 'post-thumbnails' );

Add this line where you want to show the image:

the_post_thumbnail();

Following what you seem to be doing, that is, using a meta field, try to put in a variable before echoing, sometimes it helps me spoting another problems in the code. Ex:

$key_1_value = get_post_meta($post->ID, $key, true);
echo $key_1_value;