         acceptLanguage: String? = nil,
         completionHandler: @escaping (WatsonResponse<ClassifiedImages>?, WatsonError?) -> Void)
     {
-        // save image to disk
-        let file: URL
-        do {
-            file = try saveToDisk(image: image)
-        } catch {
-            let error = WatsonError.saveData
+        // convert UIImage to Data
+        guard let imageData = getImageData(image: image) else {
+            let error = WatsonError.serialization(values: "image to data")
             completionHandler(nil, error)
             return
         }
 
-        // delete image after service call
-        let deleteFile = { try? FileManager.default.removeItem(at: file) }
-        let completion = {
-            (response: WatsonResponse<ClassifiedImages>?, error: WatsonError?) in
-            deleteFile()
-            completionHandler(response, error)
-        }
-
         self.classify(
-            imagesFile: file,
-            acceptLanguage: acceptLanguage,
+            imagesFile: imageData,
+            imagesFilename: "image.png",
             threshold: threshold,
             owners: owners,
             classifierIDs: classifierIDs,
-            completionHandler: completion
+            acceptLanguage: acceptLanguage,
+            completionHandler: completionHandler
         )
     }
 

        completionHandler: @escaping (ClassifiedImages?, WatsonError?) -> Void)
    {
        // convert UIImage to Data
        #if swift(>=4.2)
        guard let imageData = image.pngData() else {
            let error = WatsonError.serialization(values: "image to data")
            completionHandler(nil, error)
            return
        }
        #else
        guard let imageData = UIImagePNGRepresentation(image) else {
            let error = WatsonError.serialization(values: "image to data")
            completionHandler(nil, error)
            return
        }
        #endif

        self.classifyWithLocalModel(imageData: imageData, classifierIDs: classifierIDs, threshold: threshold, completionHandler: completionHandler)
    }

    /**
     Save an image to a temporary location on disk.
     The image will be compressed in an attempt to stay under the service's 10MB image size restriction.
     */
    private func saveToDisk(image: UIImage) throws -> URL {
        let filename = UUID().uuidString + ".jpg"
        let directory = NSURL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
        guard let file = directory.appendingPathComponent(filename) else { throw WatsonError.urlEncoding(path: filename) }
        guard let data = image.jpegData(compressionQuality: 0.75) else { throw WatsonError.serialization(values: "classify image") }
        try data.write(to: file)
        return file
    }
}


        image: UIImage,
        completionHandler: @escaping (WatsonResponse<DetectedFaces>?, WatsonError?) -> Void)
    {
        // convert UIImage to Data
        guard let imageData = getImageData(image: image) else {
            let error = WatsonError.serialization(values: "image to data")
            completionHandler(nil, error)
            return
        }

        self.detectFaces(imagesFile: imageData, imagesFilename: "image.png", completionHandler: completionHandler)
    }

    /**
