Competitive type II eliminations in aliphatic imides