karma: use PhantomJS
test: fix incorrect iteration over ImageData.data array