             v.imageView.image = currentlySelectedImageThumbnail ?? inputPhoto.originalImage
         default: ()
         }
-    }
-    
-    @objc
-    func cancel() {
-        didCancel?()
-    }
-    
-    @objc
-    func save() {
-        if let f = selectedFilter,
-            let applier = f.applier,
-            let ciImage = inputPhoto.originalImage.toCIImage(),
-            let modifiedFullSizeImage = applier(ciImage) {
-            inputPhoto.modifiedImage = modifiedFullSizeImage.toUIImage()
-        } else {
-            inputPhoto.modifiedImage = nil
-        }
-        didSave?(YPMediaItem.photo(p: inputPhoto))
     }
     
     fileprivate func thumbFromImage(_ img: UIImage) -> CIImage {

                                                               target: self,
                                                               action: #selector(cancel))
        }
        let rightBarButtonTitle = isFromSelectionVC ? YPConfig.wordings.done : YPConfig.wordings.next
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: rightBarButtonTitle,
                                                            style: .done,
                                                            target: self,
                                                            action: #selector(save))
        navigationItem.rightBarButtonItem?.tintColor = YPConfig.colors.tintColor
        
        YPHelper.changeBackButtonIcon(self)
        YPHelper.changeBackButtonTitle(self)

        let smallImage = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
        return smallImage!.toCIImage()!
    }
    
    // MARK: - Actions 🥂

    @objc
    func cancel() {
        didCancel?()
    }
    
    @objc
    func save() {
        guard let didSave = didSave else { return print("Don't have saveCallback") }
        self.navigationItem.rightBarButtonItem = YPLoaders.defaultLoader

        DispatchQueue.global().async {
            if let f = self.selectedFilter,
                let applier = f.applier,
                let ciImage = self.inputPhoto.originalImage.toCIImage(),
                let modifiedFullSizeImage = applier(ciImage) {
                self.inputPhoto.modifiedImage = modifiedFullSizeImage.toUIImage()
            } else {
                self.inputPhoto.modifiedImage = nil
            }
            DispatchQueue.main.async {
                didSave(YPMediaItem.photo(p: self.inputPhoto))
                self.setupRightBarButton()
            }
        }
    }
}

