There is no need for 'hybrid_get_gallery_image_count' check. Think it could be WP function get_post_galleries_images check.