How can I distinguish the first image in an image field in a Twig template?
This code in a node.html.twig template will display only the first value of an image field that has multiple values:

{{ content.field_yourfieldname.0 }}


This will only display the second value:

{{ content.field_yourfieldname.1 }}


Source

Edit: apparently that wasn't really the question, my apologies.