Elemental distribution and charge collection at the nanoscale on perovskite solar cells