The problem was caused by vector re-allocation. This is a similar
problem to what happened with the mesh factory. It was solved by
converting the texture factory to use lists instead of vectors.
The reason for using lists is to prevent the need for explicit
deallocation of resources and instead allow the use of a list to
automatically allocate/deallocate the textures/samplers/meshes.
There is an OpenGL error (1282) invalid operation that is getting
caught when switching to the imagescene. This needs to get fixed
and then hopefully the whole thing will work.