gallery-modal-setup.php : refactoring , function bsg_find_image_ids_attached_to_post()