refactored pop action from photos controller