Not so different as you think. Add this to the head of your page after the external tag for the thumbnailviewer2.js script:
Code:
<script type="text/javascript">
jQuery(function($){
$('a[rel=enlargeimage]').click(function(e){
var opts = {}, rev = this.rev.split(','), re = /:(?!\/\/)/;
for (var i = rev.length - 1; i > -1; --i){
rev[i] = rev[i].split(re);
opts[$.trim(rev[i][0])] = $.trim(rev[i][1]);
}
if(opts.link){
e.preventDefault();
location.href = opts.link;
}
});
});
</script>
Then, if you have a page configured to load onclick of the larger image, it will also be what loads onclick of the thumbnail image.
Bookmarks