Rework image cache error handling, track cache hits.

It makes more sense for StatusImage to handle a more generic error
raised from the cache implementation, and for it to decide what should
be returned rather than the cache silently return nothing and swallow
the error.