     var margin: CGFloat = 1
     var maxImage = 4
     var photoViews: [PhotoView] = []
-    var images: [UIImage] = []
+    var images: [UIImage?] = []
     
     weak open var dataSource: PhotoCollectionViewDataSource?
     weak open var delegate: PhotoCollectionViewDelegate?

        }
    }
    
    
    func tapPhotoView(sender: UITapGestureRecognizer) {
        if let tag = sender.view?.tag {

        
        for i in 0..<numShow {
            let image = dataSource.photoColletionView?(self, imageAt: i)
            images.append(image)
            if let image = image {
                if i == 0 {
                    isVertical = image.size.width < image.size.height
                }
