Improving the sustainability of organic and perovskite photovoltaic cells