fix problems with index in ControllerPhoto