added support for arbitrarily large textures