Imaging of lithium deposits gives clue to battery life