Here is your solution:
<?php
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => 4,
'post_status' => null,
'post_parent' => 'any', // any parent
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $post) {
setup_postdata($post);
?>
<a href="<?php echo get_permalink($post->post_parent) ?>"><?php echo wp_get_attachment_image($post->ID) ?></a>
<?php
}
}
?>
Make sure $post->post_parent has a value.