Use a more compact typed array to pass the image mask from the worker

https://bugzilla.mozilla.org/show_bug.cgi?id=878397