<s>[INST] Swift - check that the image already exists at a certain URL
 unforetunately the URL cannot be used directly with the Data(contentsOf:) initializer
 due to issues with cache & cookies etc. 

I have tried using the following function to check that the image already exists at a certain URL :
```swift
func imageExists(at url: URL) -> Bool {
    var request = URLRequest(url: url)
    request.cachePolicy = .reloadIgnoringLocalCacheData
    request.httpMethod = "HEAD"
    
    var exists = false
    let semaphore = DispatchSemaphore(value: 0)
    
    URLSession.shared.dataTask(with: request) { data, response, error in
        defer { semaphore.signal() }
        
        if let error = error {
            print(error)
            return
        }
        
        guard let response = response as?[/INST]