optimize ImgProcThread class.