Dump photos from database into file