Reverted removal of iterator = 0 inside getImage

To avoid JSLint warning of empty block