             contentView.addSubview(image)
             tag -= 1
         }
-
+        
         // Reverse again so that constraints match in the future
         self.icons = self.icons.reversed()
-
+        
         self.addSubview(scrollView)
         scrollView.addSubview(contentView)
-
+        
         // constraints for scrollView -> self
         self.addConstraint(NSLayoutConstraint(item: scrollView, attribute: NSLayoutAttribute.centerX, relatedBy: .equal, toItem: self, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0))
         self.addConstraint(NSLayoutConstraint(item: scrollView, attribute: NSLayoutAttribute.centerY, relatedBy: .equal, toItem: self, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 0))
         self.addConstraint(NSLayoutConstraint(item: scrollView, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 1, constant: 0))
         self.addConstraint(NSLayoutConstraint(item: scrollView, attribute: .height, relatedBy: .equal, toItem: self, attribute: .height, multiplier: 1, constant: 0))
-
+        
         // constraints for contentView -> scrollView
         scrollView.addConstraint(NSLayoutConstraint(item: contentView, attribute: NSLayoutAttribute.centerX, relatedBy: .equal, toItem: scrollView, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0))
         scrollView.addConstraint(NSLayoutConstraint(item: contentView, attribute: NSLayoutAttribute.centerY, relatedBy: .equal, toItem: scrollView, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 0))

            }
        }
    }

    /**
     Update the contraints of image spacing based on whether the images are expanded or not.
     Update content size of the containing UIScrollView.
     */
    /////////////////////////////////////////////////////////////////////////////
    fileprivate func updateSpacingConstraints() {

        // Spacing constraints for expanding
        if !isExpanded {

            let width = stretchedImageWidth < scrollView.frame.width ? scrollView.frame.width : stretchedImageWidth

            contentView.frame = CGRect(x: (contentView.frame.origin.x), y: contentView.frame.origin.y, width: width, height: scrollView.frame.height)
            scrollView.contentSize = CGSize(width: contentView.frame.width, height: scrollView.frame.height)

            for constraint in rightItemSpacingConstraints { constraint.constant = halfImageWidth + imageSpacing }
            for constraint in leftItemSpacingConstraints { constraint.constant = -(halfImageWidth + imageSpacing) }

            if let midRightConstraint = self.rightMiddleItemSpacingConstraint, let midLeftConstraint = self.leftMiddleItemSpacingConstraint {
                midRightConstraint.constant = (0.1 * imageWidth) + imageSpacing
                midLeftConstraint.constant = -((0.1 * imageWidth) + imageSpacing)
            }
        }

        // Spacing constraints for contracting
        else {
            contentView.frame = CGRect(x: scrollView.frame.origin.x, y: scrollView.frame.origin.y + 10.0, width: scrollView.frame.width, height: scrollView.frame.height)
            scrollView.contentSize = CGSize(width: contentView.frame.width, height: scrollView.frame.height)

            for constraint in rightItemSpacingConstraints { constraint.constant = 1 }
            for constraint in leftItemSpacingConstraints { constraint.constant = 1 }

            if let middleRightConstraint = self.rightMiddleItemSpacingConstraint, let middleLeftConstraint = self.leftMiddleItemSpacingConstraint {
                middleRightConstraint.constant = imageWidth * 0.25
                middleLeftConstraint.constant = -(imageWidth * 0.25)
            }
        }
    }

    /**
     Update the content size of the containing UIScrollView based on whether the images are expanded or not.
     */

        scrollView.addConstraint(NSLayoutConstraint(item: contentView, attribute: .left, relatedBy: .equal, toItem: scrollView, attribute: .left, multiplier: 1, constant: 0))
        scrollView.addConstraint(NSLayoutConstraint(item: contentView, attribute: .bottom, relatedBy: .equal, toItem: scrollView, attribute: .bottom, multiplier: 1, constant: 0))
        scrollView.addConstraint(NSLayoutConstraint(item: contentView, attribute: .right, relatedBy: .equal, toItem: scrollView, attribute: .right, multiplier: 1, constant: 0))
        
        updateConstraints()
        updateContentSize()
    }
    
    /////////////////////////////////////////////////////////////////////////////
    public func adjustView(){
        updateSpacingConstraints()
        isExpanded = !isExpanded
        displayNames()
