Basically, no there isn't a straightforward, works-always way. You could build image-references based on user input or other context. So spidering your website means that you have to execute all code paths, otherwise you might throw away stuff that you actually need.
But now for the specific case of Chris, you could use multiple approaches:
- search image for image for
occurrences in your code (maybe
automate this with visual studio
plug-ins or so)
- remove everything
and start browsing your website, add
all images that are not found. (this
depends on the ratio of not used
images versus used images)
- search
your code for all occurrences of
.png, .jpg, .gif (and so on) and
keep those images, throw everything
else away.
- ...