Need help with filling matrix images into CSS grid
There is no way to determine if an image should go to the first block.type == 'A' if statement or the second one

you could write something like this:

{% switch block.type %}
    {% case 'A' %}
        {# images for both case a1 + a2. write the loop number into the class name #}
        &lt;li class="cellA{{ loop.index }}"&gt; {# your image #}&lt;/li&gt;
    {% case 'B' %}
        {# images for case b #}
        &lt;li class="cellA1"&gt; {# your image #}&lt;/li&gt;
{% endswitch %}


That's just one of lots of possibilities