Fixing gallery links from thumbnail images