Output assets within a matrix block using Imager and Craft 3 I'm having trouble trying to output assets from an Assets field that's within a Matrix block, using Imager. The code below is only outputting the first image that has been added, over and over for each asset, rather outputting each different asset. What am I doing wrong?

I did try changing {% set logo = block.logos.first() %} to {% set logo = block.logos.all() %}, but that gave me an internal server error.

{% for block in entry.modules.all() %}

  {% if block.type == "logosBlock" %}

    {% for image in block.logos %}

        &lt;div class="logo-child"&gt;

          {% set logo = block.logos.first() %}
          {% set transformedImage = craft.imager.transformImage(logo, { width: 312, height: 200, }) %}
          &lt;img src="{{ transformedImage.url }}" alt="{{ logo.title }}"&gt;
        &lt;/div&gt;

      {% endfor %}

    &lt;/div&gt;

  {% endif %}

{% endfor %}
Why do you try to fetch the image multiple times? 

{% for image in block.logos %}


Will fetch the images and loop them {% set logo = block.logos.first() %} -> will fetch the first image again and again.

{% for image in block.logos %}
    {% set transformedImage = craft.imager.transformImage(image, { width: 312, height: 200, }) %}
    &lt;img src="{{ transformedImage.url }}" alt="{{ logo.title }}"&gt;
{% endfor %}


Should work