fixed the bug photos not showing in right order