Squashes and out of bounds bug that caused non-deterministic decisions for pixels near the edge of the image.