saving last image after terminating app using nsuserdefaults