fixed map_gif function