Assorted logic added to ImageTransferThread. Rewrites