Filepicker Image does not print to page

Hi guys,

I just started using Grav a week ago. I can’t seem to be able to get a different images showing for my feature sections. I have a modular page and I’m able to get the “first” image printed from the Page media since I copied this from the Quark template:
{% set feature_image = page.header.feature_image ? page.media[page.header.feature_image] : page.media.images|first %}

And used this in the html:

{% if feature.feature_image %}
     {{ feature_image.cropResize(300,200).html }}
{% endif %}

Here’s also the .yml:

.feature_image:
   label: Feature Image
   type: filepicker
   folder: 'self@'
   preview_images: true

I tried to modify the bit I copied from the Quark template but I usually just end up getting some error as a result or it doesn’t print to the page at all…

Any tips on how to fix this bit or just do the same thing some other way? Thanks.

So ok, after some playing around, it was quite simple in the end.

header.features:
   name: features
   type: list
   label: Features
   fields:
      .feature_image:
          label: Feature Image
          type: filepicker
          folder: '@self'
          preview_images: true
{% for feature in page.header.features %}
   <div class="feature-column {{ columns }}">
         {% set feature_image = page.media.images[feature.feature_image] %}
         {{ feature_image.html }}
   </div>
{% endfor %}