Convert empty attachment sizes to empty object intead of array

Fixes #299