Handle URLS like .shared-image.html?/photos/misc/2008/09/23/foo.jpg

FLose . and flatten query string too.