Pagination doesn't work when the post is a custom query with attachment posttype

I am displaying all images from the media library.
Since it are many images I want to paginate it
Using Bootstrap 5, custom query, “the loop”. The Show Post action with a custom query doesn’t work with attachments, therefore I have to use The Loop…

What happens is that I see the first 3 items with pagination arrows, but when I click NEXT I still se the same 3 pictures like this

Here you see the post content with the loop div and the pagination div, to give you a view what i am doing.

The loop looks like this, I could place all my args in this pinegrow action, so I dont need the “Args in own PHP block”

Here the parts of the screenshot for this The Loop action… doenst fit in one screenshot




Pls. ignore the 3 in the screenshot, posts per page, since it is overruled with: show all.

The pictures in the image library can have a category, and I gave some the category name: 3d.

If the main loop would be Show Posts and custom query, it wil not work with attachments.
The page itself is: category-3d.php
If I use show posts then it would print me Posts from 3d category, that is something else then 3d category in the media libaray images.

So maybe I shoud make a real attachment post page like in the hierarchy from WordPresss. The php file name should then be: attachment.php… but in WordPress I have no clue how I can show tht page since I cant make a menu item for that I think

Food for thought…

Pagination:

My issue with pagination I could discuss it before, see Bootstrap 4 page pagination (Bug?)

another note: Since Wordpress 6.4, attachment pages are fully disabled in Wordpress.
Ref: Changes to attachment pages – Make WordPress Core

This shouldn’t interfere with my issue, it is just a note for those who want to make an attachment page. You can enable it, therefore read the article.