Fix bugs in mipMaps generations  + clear last images from the viewer
when clearing cache.