You don't have to insert image into post after attaching it to this post.
When you edit post, click on 'Add Media' button. Upload your image and when it's uploaded just close the 'Insert Media' dialog (use 'x' button in top right corner and not 'Insert into post' button).
You can then get (and show) them with this code:
<?php
$images = new WP_Query(array('post_type' => 'attachment', 'post_mime_type' =>'image', 'posts_per_page' => -1));
while ($images->have_posts()) : $images->the_post();?>
<a href="<?php echo wp_get_attachment_url($post->ID); ?>">
<img width="100" height="100" src="<?php echo wp_get_attachment_thumb_url( $post->ID);?>" />
</a>
<?php endwhile; ?>
You could also use get_children
function to get these attachments (see below).
$attachments = get_children(array(
'post_parent' => $post->ID,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
));
foreach ($attachments as $id=>$att ) { ... }
> media > upload
and there is a link dedicated to this> attach media
.