code formatting
fix save path, close image