detect need to cache images during 404 handling