Clean up photo code
Test code refactor