I figured it out.
<?php if ( get_post_meta($post->ID, 'CUSTOM-FIELD', true) ) { ?><a href="<?php echo get_post_meta($post->ID, "CUSTOM-FIELD", $single = true); ?>"><img src="IMAGE-LOCATION" /></a><?php } ?>
That seems to work for me
I tried using that code and it keeps giving me an error message.
Last time I did it I used a similar code to the one I’m using now but with a little bit added to only show fields that had values. I just can’t remember what the extra code was