Added a patch iterator for images.