I have a gallery of 27 images with 9 images on each page, so a total of 3 pages. When I get to the 9th image on the first page, I would like the "next >" button to link to the 10th image on the 2nd page, and the 18th image "next >" button to link to the 19th image on the 3rd page, etc.
As it is currently the 9th image "next >" links back to the first image and only cycles to through these.
How do I change this? How do I get the 9th image to link to the 10th and thr 18th image to link to the 20th and so on?