                                      handler:((UIAlertAction) -> Void)? = nil) -> Void {
         let alert = UIAlertController(title: title, message: message, preferredStyle: .actionSheet)
         let cancelAction = UIAlertAction(title: NSLocalizedString("alertCancelButton", comment: "Cancel"),
-                                         style: .cancel, handler: { action in })
+                                         style: .cancel, handler: {_ in 
+                                            // Forget the choice
+                                            self.selectedCategoryId = NSNotFound
+                                         })
         let performAction = UIAlertAction(title: NSLocalizedString("alertYesButton", comment: "Yes"), style: .default, handler:handler)
     
         // Add actions

    private var inputImageIds: [Int]!
    private var inputImagesData = [PiwigoImageData]()
    private var totalNumberOfImages: Float = 0.0

    @objc func setInput(parameter:Any, for action:kPiwigoCategorySelectAction) {
        wantedAction = action

        } else {
            categoryData = categories[indexPath.row]
        }
        
        // Remember the choice
        selectedCategoryId = categoryData.albumId

        // What should we do with this selection?
        switch wantedAction {
