imaging: Fix imaging group creation

Traceback when adding machines with one ethernet card and machines with
more than one ethernet card in one shot

This commit fix it