How imaging technology is recovering damaged texts and rewriting history