Added support for textures that aren't powers of two by scaling their dimensions to the next (smallest) powers of two.