Memory swap error with ofxThreadedImageLoader

I’m using ofxThreadedImageLoader to preload some images that are used by a set of around 12 image layers. Every x seconds the app loads another batch of images using ofxThreadedImageLoader and the layers (that are an independent class that moves, fades, etc) take a new image from the batch. The cycle goes well many times but sometimes this breaks in this function in utility [line 62]:

void swap(_Ty& _Left, _Ty& _Right) noexcept(is_nothrow_move_constructible_v<_Ty>&& is_nothrow_move_assignable_v<_Ty>) {
    _Ty _Tmp = _STD move(_Left);
    _Left    = _STD move(_Right);
    _Right   = _STD move(_Tmp);

My image loader:

void ofApp::loadmemPicsByRandomFolder() {
	extern vector<ofImage> mempic;
	extern vector<CSVRowImages> mempicfiles;


	int ix = (int)ofRandom(everyfolder.size()); // choose a random folder

	for (int j = 0; j < NUMPIX; j++)
		mempicfiles[j].file = colImages[ix][j]; // colImages is a bidimensional vector with all folders and its files
		loader.loadFromDisk(mempic[j], mempicfiles[j].file);	


The WImage class function that gets a new image from the batch:

void Wimage::newImage() {

	extern vector<ofImage> mempic;
	extern vector<CSVRowImages> mempicfiles;
	extern size_t ix;

	if (mempic.size() != 0) {
		if (mempic[ix].isAllocated()) {
			if (ix >= mempic.size()) ix = 0;			
	else {
		ofLogNotice("No image loaded. Folder empty or error on db files.");

Thanks for any help, I’m in this deadline and this is driving me nuts :-/