enable images using query strings

Images with query strings failed before this patch because tjhe name of the file was not reckognized. Code is pretty self-explanatory.