From http://blog.escapecreative.com/wordpress-display-all-images-attached-to-post-page/