fix some more swapped array dimensions

it is really hard to keep this straight
make the viewport range variable
don't stop iterating if we don't find any pixels on the first try

this is kind of indicating that i might actually need to switch up my
iteration strategy if i'm going to get things to work properly as i zoom
in, though...