If a program works with no threading and not working with threading then likely reason could be the synchronization. In this specific case, with limited problem description and code snippet available, may be sync issue when accessing ImageVector.
5
solved C++ std::threads interacting although they should not [closed]