     ///
     override public func attachmentBoundsForTextContainer(textContainer: NSTextContainer?, proposedLineFragment lineFrag: CGRect, glyphPosition position: CGPoint, characterIndex charIndex: Int) -> CGRect {
         self.textContainer = textContainer
+        updateImage()
+        if image == nil {
+            return CGRectZero
+        }
+
+        let padding = textContainer?.lineFragmentPadding ?? 0
+        let width = lineFrag.width - padding * 2
+
+        return CGRect(origin: CGPointZero, size: CGSize(width: width, height: onScreenHeight(width)))
+    }
+
+    func updateImage() {
         switch kind {
         case .RemoteImage:
-            startImageFetching()
+            break
         default:
-            print("No action to do")
-        }
-        if image == nil {
-            return CGRectZero
-        }
-
-        let padding = textContainer?.lineFragmentPadding ?? 0
-        let width = lineFrag.width - padding * 2
-
-        return CGRect(origin: CGPointZero, size: CGSize(width: width, height: onScreenHeight(width)))
-    }
-
-    func startImageFetching() {
-        var remoteURL: NSURL?
+            return
+        }
+        guard !isFetchingImage else {
+            return
+        }
+        isFetchingImage = true
+
+        let imageURL: NSURL
         switch kind {
         case .RemoteImage(let url):
-            remoteURL = url
+            imageURL = url
         default:
-            remoteURL = nil
-        }
-
-        guard let imageURL = remoteURL else {
             return
         }
-        if fetchingHappening {
-            return
-        }
-        fetchingHappening = true
+
         image = imageProvider?.image(forURL: imageURL, inAttachment: self,
                                                 onSuccess: { [weak self](image) in
-                                                    self?.fetchingHappening = false
+                                                    self?.isFetchingImage = false
                                                     self?.image = image
                                                     self?.kind = .RemoteImageDownloaded(url: imageURL, image: image)
                                                     self?.triggerUpdate()
             }, onFailure: { [weak self]() in
-                self?.fetchingHappening = false
+                self?.isFetchingImage = false
                 self?.kind = .MissingImage
                 self?.triggerUpdate()
             })        

    private var glyphImage: UIImage?

    public var imageProvider: TextAttachmentImageProvider?
    public var fetchingHappening: Bool = false
    private var textContainer: NSTextContainer?

    /// Creates a new attachment


    override public func imageForBounds(imageBounds: CGRect, textContainer: NSTextContainer?, characterIndex charIndex: Int) -> UIImage? {
        self.textContainer = textContainer
        updateImage()
        guard let image = image else {
            return nil
        }
