Java Sort Object Array Javascript Duplicates In Photos