Implement save image and undo features.