Charging assisted by thermalization