There are two problems (bugs) that need to be fixed. First, the template-functions.php function getPageNumURL() needs to be fixed to handle custom pages:
` $pg = stripSuffix($_zp_gallery_page);
if (array_key_exists($pg, $_zp_conf_vars['special_pages'])) {
$pagination1 = preg_replace('~^_PAGE_/~', _PAGE_ . '/', $_zp_conf_vars['special_pages'][$pg]['rewrite']) . '/';
} else {
$pagination1 = '/' . _PAGE_ . '/' . $pg . '/';
}`
Then the galleryToken plugin needs to have added a rewrite rule for handling the page numbers:
`$_zp_conf_vars['special_pages'][] = array('define' => false, 'rewrite' => '%GALLERY_PAGE%/([0-9]+)', 'rule' => '^%REWRITE%/*$ index.php?p=gallery&page=$1' . ' [L,QSA]');`