fixed the photo switching