Check that zoom reference point is valid before using it

We had a case where the final division in calculating the reference point turned into an effective divide-by-zero (floating point precision error, mumble mumble), resulting in an invalid reference point and images blanking out due to the invalid reference point. This commit simply checks that the reference point isn't NaN before using it.