use attached image and gallery functions from WP 3.6 if present
add post_id context to get_attached_media from the current post context
Merge pull request #459 from niallkennedy/ogp-images

use attached image and gallery functions from WP 3.6 if present