title: When I upload image to Firebase Storage, an extra image appears. Swift 4, Xcode 9
body: <p>I have not seen this problem or issue raised anywhere else online. </p>
  
  <p>When I upload an image(s) to Firebase Storage, one extra duplicate image appears. i.e If I upload 1 image, 2 will appear in the Storage (if I upload 3, 4 will appear), it looks like this:
  <a href="https://i.stack.imgur.com/SKeOU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SKeOU.png" alt="Duplicate image"></a></p>
  
  <p>I have a takePicture ViewController where I handle the actual image taking and here is my upload to Firebase Storage class code:</p>
  
  <pre><code>import UIKit
  import FirebaseStorage
  import FirebaseDatabase
  import FirebaseAuth
  import Firebase
  
  class ImageUploadManager: NSObject {
  
      let imageName = NSUUID().uuidString
      let postImage = takePicViewController().postImage
      let images = takePicViewController().images
  
  
      //Start of send to storage fuction
      func uploadImage(_ image: UIImage, postNumber: Int, progressBlock: @escaping (_ percentage: Double) -&gt; Void, completionBlock: @escaping (_ url: String?, _ errorMessage: String?) -&gt; Void) {
  
          let storageRef = Storage.storage().reference().child((Auth.auth().currentUser?.uid)!).child("post\(takePicViewController().finalPost + postNumber)").child(imageName)
  
          if let imageData = UIImageJPEGRepresentation(image, 0.8) {
              let metadata = storageRef
  
              let uploadTask = metadata.putData(imageData, metadata: nil) { (metadata, error) in
  
                  guard let metadata = metadata else {
                      return
                  }
  
                  // You can also access to download URL after upload.
  //                storageRef.downloadURL { (url, error) in
  //
  //                    guard let downloadURL = url else {
  //                        return
  //                    }
  //
  //                }
              }
  
              // For progress
              uploadTask.observe(.progress, handler: { (snapshot) in
                  guard let progress = snapshot.progress else {
                      return
                  }
  
                  let percentage = (Float(progress.completedUnitCount) / Float(progress.totalUnitCount))
                  progressBlock(Double(percentage))
              })
  
          } else {
              completionBlock(nil, "Image could not be converted to Data.")
          }
  
      } //End of send to storage function
  
  
  } //End of ImgUploadClass
  </code></pre>
  
  <p>Also these are my Firebase Storage rules:</p>
  
  <pre><code>  service firebase.storage {
    match /b/{bucket}/o {
      match /{allPaths=**} {
        allow read, write: if request.auth != null;
      }
    }
  }
  </code></pre>
  
  <p>And also my Firebase Storage is structured as: UID/post(#)/imageName</p>
  
  <p>Lastly, I also upload to Firebase Realtime Database, however that is irrelevant for this problem.</p>