 import FLAnimatedImage
 import SDWebImage
 import SVGKit
+import Alamofire
 
 public class StreamImageCell: StreamRegionableCell {
 

    @IBOutlet weak var imageRightConstraint: NSLayoutConstraint?

    weak var delegate: StreamImageCellDelegate?
    var presentedImageUrl:NSURL?
    var serverProvidedAspectRatio:CGFloat?
    public var isLargeImage: Bool {

    }

    private func loadGif(url:NSURL) {
        if let path = url.absoluteString {
            if let data = GifCache.objectForKey(path) as? NSData {
                self.displayAnimatedGif(data)
            }
            else {
                self.request?.cancel()
                self.request = Alamofire.request(.GET, path).response { (request, _, data, error) in
                    if let data = data as? NSData where error == nil {
                        GifCache.setObject(data, forKey: request.URLString)
                        self.displayAnimatedGif(data)
                    }
                }
            }
        }
    }

    private func displayAnimatedGif(data: NSData) {
        var animatedImage = FLAnimatedImage(animatedGIFData: data)
        dispatch_async(dispatch_get_main_queue()) {
            self.imageView.alpha = 1.0
            self.aspectRatio = (animatedImage.size.width / animatedImage.size.height)
            self.imageView.animatedImage = animatedImage
            self.circle.stopPulse()
        }
    }

    private func loadNonGif(url:NSURL) {
        self.imageView.sd_setImageWithURL(url) { (image, _, type, _) in
            if let image = image {
                self.aspectRatio = (image.size.width / image.size.height)
                if self.serverProvidedAspectRatio == nil {
