this is how i use it = with image opening in a new window
<a href="
<?php
$link = get_post_meta($post->ID, "link", true);
if ($link !=='') {echo "$link";} ?>
" target="_blank"><img srce="<?php $banner1 = get_post_meta($post->ID, 'banner1', true);
echo wp_get_attachment_image($banner1); ?></a>