                 strongSelf.image = nil
                 strongSelf.invalidateLayout(inTextContainer: textContainer)
             })
-
-        self.image = image
     }
     
     fileprivate func invalidateLayout(inTextContainer textContainer: NSTextContainer?) {

        }
        
        isFetchingImage = true
        
        let image = delegate.mediaAttachment(self, imageForURL: url, onSuccess: { [weak self] image in
                guard let strongSelf = self else {
                    return
                }

        _ mediaAttachment: MediaAttachment,
        imageForURL url: URL,
        onSuccess success: @escaping (UIImage) -> (),
        onFailure failure: @escaping () -> ())

    func mediaAttachmentPlaceholderImageFor(attachment: MediaAttachment) -> UIImage
}

/// Custom text attachment.
///
open class MediaAttachment: NSTextAttachment {

    /// Attributes accessible by the user, for general purposes.
    ///
    public var extraAttributes = [String: String]()
