         photoView.translatesAutoresizingMaskIntoConstraints = false;
         addSubview(photoView)
 
-        titleLabel.leadingAnchor.constraintEqualToAnchor(self.leadingAnchor, constant: 30).active = true
-        titleLabel.trailingAnchor.constraintEqualToAnchor(self.trailingAnchor, constant: 30).active = true
-        titleLabel.topAnchor.constraintEqualToAnchor(self.topAnchor, constant: 50).active = true
+        titleLabel.leadingAnchor.constraintEqualToAnchor(self.leadingAnchor, constant: titleLabelLeftMargin).active = true
+        titleLabel.trailingAnchor.constraintEqualToAnchor(self.trailingAnchor, constant: titleLabelRightMargin).active = true
+        titleLabel.topAnchor.constraintEqualToAnchor(self.topAnchor, constant: titleLabelTopMargin).active = true
         
         // Calculate photo height
         let photoAspectRatio = photo.height / photo.width
         self.calculatedPhotoHeight = maxWidth * photoAspectRatio
         
-        photoView.topAnchor.constraintEqualToAnchor(titleLabel.bottomAnchor, constant: 20).active = true
+        photoView.topAnchor.constraintEqualToAnchor(titleLabel.bottomAnchor, constant: photoViewTopMargin).active = true
         photoView.leadingAnchor.constraintEqualToAnchor(self.leadingAnchor).active = true
         photoView.widthAnchor.constraintEqualToConstant(maxWidth).active = true
         photoView.heightAnchor.constraintEqualToConstant(self.calculatedPhotoHeight).active = true

    var photoView : UIImageView!
    var titleLabel : UILabel!
    
    private var calculatedPhotoHeight : CGFloat!
    
    override func initialize() {
        super.initialize()
        
        self.translatesAutoresizingMaskIntoConstraints = false;
        
        titleLabel = UILabel()
        titleLabel.translatesAutoresizingMaskIntoConstraints = false;
        titleLabel.textColor = UIColor.whiteColor()
        addSubview(titleLabel)
        
        photoView = UIImageView()

    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel.text = photo.title.uppercaseString;
        
        let preferredImageUrlString = photo.imageUrls[ImageSize.Large]!
        let imageUrl = NSURL(string: preferredImageUrlString)!
        photoView.af_setImageWithURL(imageUrl)
    }
    
    override func estimatedHeight(width: CGFloat) -> CGFloat {
        // Calculate title label
        let titleSize = NSString(string : photo.title).boundingRectWithSize(CGSizeMake(maxWidth, CGFloat.max),
                                                                            options: .UsesLineFragmentOrigin,
                                                                            attributes: [NSFontAttributeName: titleFont!],
                                                                            context: nil).size;
        
        return self.calculatedPhotoHeight + titleSize.height + titleLabelTopMargin + photoViewTopMargin;
    }
    
}
