Partial MipMaps support, refactoring