Photo sorting program on Java