I think there are 2 pieces of logic you need to apply to your navigation,
1. knowing the current id, you need to increment the id+ 1 when clicking on next, -1 when clicking on prev
so, for example, the link would use the current $_GET parameter and add / subtract from that
2. if you are wanting to loop from the last record to the first, without coming to the end, you will also need to compare the number of rows in the recordset, ($totalRows_WADAartworks). if this value = $_GET parameter, then your link should point to id number one.
(same logic, in reverse if you want to go from first record to the last, ie if $_GET parameter -1 = 0 then your link should point to id number $totalRows_WADAartworks.
This code should be flexible enough so that adding new images will not break it