saving application state and images to disk