Improve img.py to check for dead images and cache results on disk.