clean up and test photo/db interaction