Want to add links to your WordPress Gallery images?

One of the odd things about using the WordPress gallery shortcode is that you cannot attach custom links to your images (thumbnails). By default, they link to either a larger version of the same image or they link to an attachment page that acts like a slideshow viewer. But what if you want to link your images to something else such as a page or even an external website?