{% if bannerSets is defined and bannerSets is not empty %}
{% for bannerSet in bannerSets %}
{% for i in 1..bannerSet.blockCount %}
{% set blockImage = attribute(bannerSet, 'block' ~ i ~ 'Image') %}
{% set blockLink = attribute(bannerSet, 'block' ~ i ~ 'Link') %}
{% if blockImage is not empty %}