Workaround for weird Chrome behaviour with canvas/getImageData