Url with querystring

I had a problem with facebook login. Stapler encode url given by facebook, so then it messes the Imagine code since it looks for extension literally from the filename (instead of using mime type).

So, I in my case, removed the query string solved the problem.