Output map to input file.png
Remove extra puts statment after writing the image.
Improve filename conversion.
refactor organize_images