I am working with an asp.net mvc application. I have the following entry in web.config to handle 404's

```
    <httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/Error/Error404" responseMode="ExecuteURL" />
</httpErrors>

```

This works fine for when pages are requested, it redirects to my 404 view. However for missing images it also redirects to the 404 page ie. the response for the image is the 404 page.

As this is a performance issue, is there any way I can alter the above so that only 404 from "pages" and not resources such as images trigger a redirect to the 404 page?