Fix crash bilinear upsampling tall images.

When increasing the image size, x was clamping to height-1
instead of width-1.
Fix bilinear upsampling correctness.

Slight error transcribing ruby to c. I'm not sure how it manifested.
Merge pull request #13 from retailnext/fix-bilinear-upsampling

Fix bilinear upsampling