Added logic to save a picture.