update tree sort method in image module