Adding protections in map_image