Use group type when creating attachments

Closes #33