Photos app timeline problem

I have a lot of photos added to my nextcloud and mainly use the memories app to scroll through them. There, everything works as expected. However, with the photos app, the timeline is always showing July 2020 on top. Once I scroll down and then back up again, it suddenly starts to add recent pictures from 2024 and 2023 to the top. When I reload, the timeline again starts with July 2020. Something is off there. Is there a way to re-index all files for the photos app similar to the memories app or to reset the photos app somehow?

I thought about setting up my nextcloud new, but that would probably mean losing my albums, or is there a way to save them that I do not know about?

Iโ€™m using Nextcloud 28.0.2 and Photos 2.4.0

solved it by running occ files:scan --all --generate-metadata

The --generate-metadata is what I was looking for. Took a while to finish though

Thank you for finding this solution. Surprisingly this command line switch isnโ€™t shown with NC 27.1.6. It must have been introduced with NC 28.x.