Remove nil from format options

When the format is not specified, the formats array includes nil `[nil, "text/html", "text/plain"]`. `find_part` with a `nil` format will bring back the plain text version. So if a format isn't specified, we remove before we find the preferred format.