diff --git a/pyqtgraph/graphicsItems/ImageItem.py b/pyqtgraph/graphicsItems/ImageItem.py
index 9e40e325ccdc6f82799d0cb7f37756616f4bf95e..7c80859d4eb115aada6b539f051aeaa67eea6be8 100644
--- a/pyqtgraph/graphicsItems/ImageItem.py
+++ b/pyqtgraph/graphicsItems/ImageItem.py
@@ -310,8 +310,8 @@ class ImageItem(GraphicsObject):
         if self.image is None:
             return None,None
         if step == 'auto':
-            step = (np.ceil(self.image.shape[0] / targetSize),
-                    np.ceil(self.image.shape[1] / targetSize))
+            step = (np.ceil(self.image.shape[0] / targetImageSize),
+                    np.ceil(self.image.shape[1] / targetImageSize))
         if np.isscalar(step):
             step = (step, step)
         stepData = self.image[::step[0], ::step[1]]