Updated code for working threaded image transmission while recording raw and processed frames.