Sort images of a class