Don't write outside of a context.

Some implementations (eg. node-canvas) do not correctly handle writing
(putImageData) of image data outside context bounds.
Merge branch 'image-bounds' into peerlibrary