@acrylian
I have removed the code, so real album is displayed correctly now.
Nevertheless, visit this dynamic album:
https://clatique.fr/multimedia/Nouveautes/
Then choose
Liffol le Petit, vue aérienne (S) (bottom of the page)
At the bottom of the image page, a button link " Voir la galerie "
It does work now, but with the original code, I got an error because of page 2 computed instead of page 1. There is no page 2 in the mentioned original album!
As you can see, this album contains a sub album named Église Saint Remy.
(yellow text on dark grey background thumb)
As you can see, I use Options -> Theme -> Transition set to "combined"
The button link from the image page did work if I set
Options -> Theme -> Transition to "separate"
There is no "Transition" test in the getAlbumURL function.
This is why page number is wrong if "combined" is used with other (my AND lines) conditions.
Problem appears only if you reach an image from a dynamic album.
Because if you reach the image from it's original album, the getAlbumURL function DOES work.
The getAlbumURL function does also work if no subalbum exists in the original album, even if you reach a picture from a dynamic album !
This is why I used "AND" 2 times in my original message.