Rich Morin schrieb: ...
img_name is the primary key for the table, so using SQL to find a page's neighbors by sort order should be relatively inexpensive.
...
I now found out, that there are plans for a completely different solution (see [[s:en:User:Tim_Starling/ScanSet_PNG_demo]]), but thank you very much for the answer.
Jofi