SELECT MAX(id), name FROM photos GROUP BY id DESC