Added support for dynamicly sized textures.