solution for ordering the photos