Images should be sorted by filename but it seems random or by date(?)

I searched the forum and found some similar but old topics and not really an answer why this is happening.

I have many galleries, and upload many images to a single post. In the backend images are not sorted by filename. It seems random, maybe date. My galleries show pictures in the same order.

I always use the same naming scheme as to avoid order problems

2019-06-15-Image1
2019-06-15-Image2
2019-06-15-Image3
2019-06-14-Image1
2019-06-14-Image2
2018-07-12-Images…
Etc

Other naming schemes don’t work as expected either. Any ideas?

regards

Maybe it has something to do with the PHP asort function

Anyway I solved it in my gallery template twig…in case someone stumbles upon this post.

This orders them from new to old (in my case)

{% for image in page.media.images|sort|reverse %}