Change the way to check instance type to handle codecs.open().read()
Remove query parameter if application request for static files