Correctly limit bounds in PutImageData to prevent segment fault

Addresses one part of #59. Otherwise, if source image is larger than canvas, it tries to write outside of the canvas memory block. Not good.