Amplitude Analysis of the Decays η′ →π+π-π0 and η′ →π0π0π0