fix mipmaps and not-power-of-2 textures