     private func setupForOrientation(orientation: UIInterfaceOrientation) {
         if orientation.isLandscape {
             thumbnailCols = 5
-        } else if UIScreen.mainScreen().traitCollection.horizontalSizeClass == .Compact {
+        } else if UIScreen.mainScreen().traitCollection.userInterfaceIdiom == .Pad  {
+            thumbnailCols = 4
+        } else {
             thumbnailCols = 3
-        } else {
-            thumbnailCols = 4
         }
     }
 

        return thumbnailRows * thumbnailCols
    }

    private lazy var width: CGFloat = { return self.collectionView?.frame.width ?? 0 }()

    private lazy var height: CGFloat? = {
        return self.collectionView?.frame.height
        }()

    // The width and height of the thumbnail here are the width and height of the tile itself, not the image inside the tile.
    private var thumbnailWidth: CGFloat {

    }

    override init() {
        width = 0; height = 0
        super.init()
        let size = self.collectionView?.bounds.size ?? UIScreen.mainScreen().bounds.size
        transitionToOrientation(UIView.viewOrientationForSize(size), atSize: size)
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    private func transitionToOrientation(orientation: UIInterfaceOrientation, atSize size: CGSize) {
        setupForOrientation(orientation)
        height = size.height
        width = size.width
