{% set gallery_has_images = gallery_images is defined and gallery_images and (gallery_images|length > 0) %}