optimizing images and adding back the map