fix a bug in GalleryHelper::get_images_from_main_language()