Page through the dynamic pages using a Next button. When there are no more pages, go back to the beginning. This works the same for the Previous button. When there are no more previous pages, go to the last page.
Go to the Dynamic Page Loop example page.
See more examples at Gramp's Workbench.