             else {
                 let imageInfo = CKImageInformation(url: url, size: backendSize, orientation: .up)
                 let index = self.imageUrls.index(of: url)
-                self.imageInformationDic[index!] = imageInfo
+                tmpImageInformationDic[index!] = imageInfo
                 loadedCount += 1
                 
                 if loadedCount == count {
-                    self.calculateSize()
+                    self.calculateSize(imageInformDic: tmpImageInformationDic)
                 }
             }
         }

        // Dispose of any resources that can be recreated.
    }
    
    func calculateSize() {
        var sampleSize = CGSize.zero
        for  (_, inform) in self.imageInformationDic {
            if inform.size.height > inform.size.width {

                    if let image = image, let url = url {
                        let imageInfo = CKImageInformation(url: url, size: image.size, orientation: image.imageOrientation)
                        let index = self.imageUrls.index(of: url)
                        tmpImageInformationDic[index!] = imageInfo
                        loadedCount += 1
                    }
                    
                    if loadedCount == count {
                        self.calculateSize(imageInformDic: tmpImageInformationDic)
                    }
                    else {
                        self.retryTimes += 1
