     var userDidCancel: Bool = false
     var didFailLoadingImage: Bool = false
     
+    var completionHandler: ((Data?, Error?) -> Void)?
+    
     fileprivate var toolTipWhileLoading: String?
     fileprivate var toolTipWhenFinished: String?
     fileprivate var toolTipWhenFinishedWithError: String?

        imageDownloadData = nil
        imageURLDownloadTask = nil
        errorImage = nil

    }
    
    //MARK: Tooltips

        guard error == nil else {
            Swift.print(error!.localizedDescription)
            failureReset()
            completionHandler?(nil, error)
            return;
        }
        
        
        didFailLoadingImage = false
        userDidCancel = false
        guard let data = imageDownloadData else {
            Swift.print("Image data not downloaded correctly.")
            failureReset()
            completionHandler?(nil, error)
            return;
        }
        guard let img: NSImage = NSImage(data: data) else {
            Swift.print("Error forming image from data.")
            failureReset()
            completionHandler?(nil, error)
            return;
        }
        
        image = img
        isLoadingImage = false
        
