Several bug fixes introduced by redoing the cache format of the images