Implemented image saving.