Cache: never allocate images while under the lock, instead do it in the
caller thread afterwards