Plugin tested up to WordPress version 3.5.1
To add a custom URL to to an Image in your gallery, edit the image and add the desired image URL to the new field "Custom Link" under the description field.
Add this shortcode to your WordPress post or page: [gallery link="custom"]