added logic to remove and add photos