Don’t know if it helps, but I’m using the following function in functions.php to retrieve the image from nextgen and place it directly in the opengraph metatag (I get the correct nextgen ID from a custom field):
<meta property="og:image" content="<?php echo getFacebookThumbFromNextgen(get_field('nextgen_code')); ?>" />
In functions.php I have the following function:
function getFacebookThumbFromNextgen($galleryID=false) {
if (!$galleryID) {
return "No gallery ID provided";
} else {
global $wpdb;
$imageDetails = $wpdb->get_results("SELECT wp_ngg_gallery.path,wp_ngg_pictures.filename FROM wp_ngg_gallery, wp_ngg_pictures WHERE wp_ngg_gallery.gid = {$galleryID} AND wp_ngg_pictures.galleryid = wp_ngg_gallery.gid LIMIT 0, 1");
return get_bloginfo("wpurl") . "/". $imageDetails[0]->path ."/". $imageDetails[0]->filename;
}
}