If your images aren’t displayed correctly with the default extensions (e.g. .jpg, .gif, .png, etc.), but everything is working fine when you remove the extension or change it to .aspx, add the following code to your web.config file under the <system.webSerer> section:
<httpErrors existingResponse="PassThrough" />
<modules runAllManagedModulesForAllRequests="true">
-md-