I have a gallery section on site, where I have shown year-wise images and this section utilizes pagination. when you click on page 2 you will be able to see all the images that were posted in 2021 and on page 3 you will be able to see the year 2020's images. and I want to display years in descending order(i.e.: 2022, 2021,2020,.....) instead of 1,2,3 on pagination.
Pleas find the below attached image to see the structure I've created for gallery section in a processwire:
and this is how I fetch data on my page :
and the below code is for pagination :
And this is how my section looks like :
I'm not sure how to go about this so any direction would be helpful.