added functionality to change selected photo