Add basic logic to save image.