rewriting URLs in captions that point back to gallery