fix a bug with not deleting subfolders with cache images
fix encoding issues