code refactoring, new next_mipmap_level_size() function