Pass correct buffer sizes to readPixels