If you are able to re-sign an executable that is already in the ROM, i would try that, so you know the problem isn't within the native code, but only with the signing. Or maybe the other way round which would be awesome. :)
Ok then i would suggest, a 3 thread setup.
1 to get the bytes, and put it into a ring buffer, the next pull it from the buffer and convert it to jpeg and put it into another buffer, and the last for sending it.
I would check if it makes sence to...