Sort commands by number of textures.