Boundary drawing bug

This came up when images were not square. There was a bug where rows and
columns got mixed up in the image size checks. Just tested to make sure
this works well.