Fixed invalid URLs in gallery image handling code.