watch this space for additional helpful material.
return (inY * width + inX) * 3;
to
return ((height - 1 - inY) * width + inX) * 3;
This will flip all images upside down. I was unhappy with the previous fix because it tied the construction of the camera basis to a particular image format, but I thought it was the only quick fix I could post. If you have already fixed the problem, feel free to change to this solution if you like it better or not. Again your image orientation will not affect the grade, so any way you want to fix this problem (or even not fix it) is fine with us.