     }
     
     private func updateMinTrackView() {
-        minTrackView.image = minImage
-        if let minImage = minImage {
+        minTrackView.image = minTrackImage
+        if let minTrackImage = minTrackImage {
             if isHorizontal {
-                minTrackView.frame = CGRect(origin: CGPoint(x: 0.0, y: (bounds.height - minImage.size.height) / 2.0), size: minImage.size)
-            } else {
-                minTrackView.frame = CGRect(origin: CGPoint(x: (bounds.width - minImage.size.width) / 2.0, y: 0.0), size: minImage.size)
+                minTrackView.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.5 * (bounds.height - minTrackImage.size.height)), size: minTrackImage.size)
+            } else {
+                minTrackView.frame = CGRect(origin: CGPoint(x: 0.5 * (bounds.width - minTrackImage.size.width), y: 0.0), size: minTrackImage.size)
             }
         }
     }
     private func updateMaxTrackView() {
-        maxTrackView.image = maxImage
-        if let maxImage = maxImage {
+        maxTrackView.image = maxTrackImage
+        if let maxTrackImage = maxTrackImage {
             if isHorizontal {
-                maxTrackView.frame = CGRect(origin: CGPoint(x: bounds.width - maxImage.size.width, y: (bounds.height - maxImage.size.height) / 2.0), size: maxImage.size)
-            } else {
-                maxTrackView.frame = CGRect(origin: CGPoint(x: (bounds.width - maxImage.size.width) / 2.0, y: bounds.height - maxImage.size.height), size: maxImage.size)
+                maxTrackView.frame = CGRect(origin: CGPoint(x: bounds.width - maxTrackImage.size.width, y: 0.5 * (bounds.height - maxTrackImage.size.height)), size: maxTrackImage.size)
+            } else {
+                maxTrackView.frame = CGRect(origin: CGPoint(x: 0.5 * (bounds.width - maxTrackImage.size.width), y: bounds.height - maxTrackImage.size.height), size: maxTrackImage.size)
             }
         }
     }

    @IBInspectable public var thumbCornerRadius: CGFloat = 0.0 {
        didSet {
            if thumbCornerRadius * 2.0 > thumbWidth || thumbCornerRadius * 2.0 > thumbHeight {
                thumbCornerRadius = min(thumbWidth, thumbHeight) / 2.0
            }
            updateThumbView()
        }

    }
    private var trackHeight : CGFloat {
        if !isHorizontal {
            return bounds.height - (minTrackImage?.size.height ?? 0) - (maxTrackImage?.size.height ?? 0)
        }
        if trackImage == nil {
            return trackThickness
