Image analysis of grain packings: Characterization of contacts and homogeneity