Fix Image Saving Bug

Fix a bug that caused images to be saved when the generate button was
pressed.