In case anyone still cares, here's a non-hacky, semi-clean way to get a Next Image link. Place the function in your display.class and call it like do others. Can modify it to make a prev image link as well, jsut check if prev is below 0 or not. See dev site in my sig to see it action.
// Shows a link to the next image in current directory
function showNextButton() {
global $database;
$gallery = rsgGalleryManager::get();
$galid=$gallery->id;
$ceiling = $gallery->itemCount();
// If the ID is set in rsgInstance, then get the current page from there
if( rsgInstance::getInt( 'id', 0 ) )
{
$curimage = $gallery->indexOfItem();
$nextlink = $curimage+1;
}
else // ID NOT SET, so get it from limitstart in address bar
{
$limitstart = mosGetParam ( $_REQUEST, 'limitstart', 0);
$nextlink = $limitstart+1;
}
// Check if last page. If so, start over at 1
if ($nextlink >= $ceiling)
{
$nextlink = 0;
}
echo '<a href="/index.php?option=com_rsgallery2&page=inline&gid='. $galid . '&limit=1&limitstart=' . $nextlink .'">Next Image</a>';
}