Clean up and fix the photo.h bug