From http://wp-snippets.com/show-images-from-post-or-page-attachments/