If you convert this code to PHP and dump the result in the work template, do you always get the same result when you reload the page? Do the images have consecutive sort numbers, or did the sorting maybe get messed up in the sense that images have the same sorting number?
Turned out the files was not being assigned the template on upload, and therefore not having the sort number.
In my blueprint for the individual work project I had the file upload under ‘field’ and changing it to ‘sections’ made it assign the template correctly.
columns:
- width: 1/2
sections: <——— this was field before, changing it to sections fixed it.
media:
label: media files
type: files
layout: cards
size: small
template: image
image:
back: white
cover: false
info: "{{ file.template }}"