Cleaning up avatar and photo code