         self.popupScrollView.backgroundColor = bgColor
     }
 
-    func setImageIndex(indexFloat: CGFloat) {
-        let num = CGFloat(self.scrollViewWidth) * indexFloat
-        self.popupScrollView?.setContentOffset(CGPoint(x: num, y: 0.0), animated: false)
-    }
-
+    // MARK: - Set Image Index
     func setImageIndex(indexValue: Int) {
         let num = Int(self.scrollViewWidth) * indexValue
         self.popupScrollView.setContentOffset(CGPoint(x: num, y: 0), animated: false)


            if (imagePath?.contains("http"))! {
                imageView.sd_setImage(with: URL(string: imagePath!), placeholderImage: UIImage(named: "no_preview.png"))
            }
                else {
                    var path = self.getDocumentDirPath()
                    path = path.appendingFormat("/%@", imagePath!)
                    let tempImage = UIImage(contentsOfFile: path)
                    imageView.image = tempImage
            }

            imageView.contentMode = UIViewContentMode.scaleAspectFit
            imageView.clipsToBounds = true

            self.popupScrollView.addSubview(imageView)
        }
    }

    func getDocumentDirPath() -> String {
        let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
        return documentsPath

        return instance
    }()

    // MARK: - Init VC with Parent View
    func initWithParentView(_ parentView: UIView) -> ImageSliderSwift {

        self.parentView = parentView

