                         if let data = TMCache.sharedCache().objectForKey(imageURL.absoluteString) as? NSData {
                             imageView.animatedImage = FLAnimatedImage(animatedGIFData: data)
                         } else {
-                            imageDownloader.downloadImageWithURL(imageURL, options: SDWebImageDownloaderOptions.UseNSURLCache, progress: nil, completed: { (image, data, error, finished) -> Void in
+                            let imageDownloadOperation = imageDownloader.downloadImageWithURL(imageURL, options: SDWebImageDownloaderOptions.UseNSURLCache, progress: nil, completed: { (image, data, error, finished) -> Void in
                                 if finished && error == nil {
                                     imageView.animatedImage = FLAnimatedImage(animatedGIFData: data)
                                     TMCache.sharedCache().setObject(data, forKey: imageURL.absoluteString)
                                 }
                             })
+                            downloadOperations.append(imageDownloadOperation)
                         }
                     } else {
                         imageView.sd_setImageWithURL(imageURL, placeholderImage: UIImage(named: "Placeholder"))


    override func prepareForReuse() {
        super.prepareForReuse()

        if let imageViews = self.imageViews {
            for imageView in imageViews {
                imageView.image = nil
                imageView.animatedImage = nil
                imageView.removeFromSuperview()
            }
        }

        self.imageViews = nil
    }

    func updateImages() {
        if let images = self.images {
            if let contentWidth = self.contentWidth {
                if let imageViews = self.imageViews {
                    for imageView in imageViews {
                        imageView.image = nil
                        imageView.animatedImage = nil
                        imageView.removeFromSuperview()
                    }
                }

                let imageManager = SDWebImageManager.sharedManager()
                let imageDownloader = SDWebImageDownloader.sharedDownloader()
                let widthRatio: Float = 1.0 / Float(images.count)
                var imageViews = Array<FLAnimatedImageView>()
                var lastImageView: UIImageView?
                for image in images {
                    let imageView = FLAnimatedImageView()


    var imageViews: Array<FLAnimatedImageView>?
    var shareHandler: ((UIImage) -> ())?
    var imageDownloadOperations: Array<SDWebImageOperation>?
    
    var contentWidth: CGFloat? {
        didSet {
