texture: support maxWidth, maxHeight, and pow2 settings