fix handling of groups on image copy