Changed the initialization of the textures and images