Add group to layer before calling toImage

toImage can't be called on something unless it's part of a layer
apparently, so make sure we do that before attempting to toImage things.