fix the buildMipMapLevel code