Slightly simplify the mimetype logic.