In imagePickerControllerDidCancel: change from self to picker.presentingViewController.