Fix parallel_image bug: if more threads than scanlines, could mess up ranges.