Remember that when you use a std::vector, they can be moved when resized. This means that any pointer to a vector's elements are no longer pointing to the correct thing.
When you set a texture, you are assigning a pointer to that texture.
If those elements are moved (along with their textures), you will need to re-assign the pointer (re-set the texture). Basically, add them all to the vector first, then set the textures. Or, reserve or pre-size the vector so that it doesn't get moved.