public void dispose(boolean cache, boolean imageRecoverableElsewise) {
        // empty the image store
        if (imageStore != null) {
            // We don't look at if( !cache && isCached ) to delete
            //   the temp file, because the CacheManager handles it

            // cache to disk for fast access at a later time
            if (cache && isCachingEnabled && !isCached && !imageRecoverableElsewise) {
                setImage(imageStore, true);
            }
            // delete the resources used by the image source
            if (!cache || isCached || imageRecoverableElsewise) {
                //imageStore.flush();
                imageStore = null;
            }
        }
    }