refactor to be more efficient. display photos with most recent at top