Corrected bug for cache image generator