         cell.textLabel?.textAlignment = .Center
         cell.textLabel?.textColor = tableView.tintColor
         cell.textLabel?.font = UIFont.systemFontOfSize(21)
-        cell.textLabel?.text = actions[buttonIndexForRow(indexPath.row)].title(selectedPhotoIndices.count)
+        cell.textLabel?.text = actions[indexPath.row].title(selectedPhotoIndices.count)
         
         return cell
     }

    private(set) var actions = [ImageAction]()
    private var assets = [PHAsset]()
    private var selectedPhotoIndices = [Int]()
    private var previewsPhotos: Bool {
        return (assets.count > 0)
    }
    private(set) var enlargedPreviews = false
    
    private var supplementaryViews = [Int: PreviewSupplementaryView]()
    
    private var firstButtonIndex: Int {
        return previewsPhotos ? 1 : 0
    }
    
    private let imageManager = PHCachingImageManager()
    

        
        presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
        
        actions[indexPath.row].handle(numberOfPhotos: selectedPhotoIndices.count)
    }
    
    // MARK: - UICollectionViewDataSource
