Taking photographs ruins memory, research finds