If Cancel is selected, allow the view controller to be dismissed even though the delegate responds to the imagePickerDidCancel method. Note that imagePickerController is a private property.
Fix for iOS versions lower than 7: If instance response to the new methods, then use these methods. Otherwise, use the old (deprecated) methods.