Fixes on CachedImage and trace removing