Merge "Add better error handling for savePicture and restorePicture"