(solved) Image derivatives from file upload

I am having a bit of trouble being able to use Grav’s responsive image srcset feature with images that a user would upload from admin. Since it returns an array I wasn’t sure if it was possible to pass the same flag somehow or if at all possible since I am only able to return a path.

I have tried this:

{% for f_image_path in p.header.project_featured_image %}
   {% set f_image = f_image_path.path.derivatives(460,1280,120).html %}
   {{ f_image }}
{% endfor %}

but no luck. Also not having luck with something like
{{ p.header.project_featured_image.derivatives( 460, 1280, 120 ).html }}

This works {{ p.media.images|first.derivatives( 460, 1280, 120 ).sizes('100vw').html }} but of course if I were to add more images that are part of the “project” it will display the last uploaded one.

Got it working!

{% for featuredimage in page.header.project_featured_image %}
  {{ page.media[featuredimage.name].derivatives(460,1280,120).sizes('100vw').html }}
{% endfor %}