By default, Next Gen Gallery thumbnails don’t link to a URL. If you’d like them to, then this snippet is for you.
To add this code, you’ll need to edit the Next Gen Gallery templates file. This step involves adding some PHP code to the nextgen-gallery/view/gallery.php file.
You’ll also need to create a custom field ‘LINK’ using ngg custom fields plugin.
For more information, refer to the 2 complete tutorials included in the link below: