Use wood filler or caulk to fill in the gaps and nail holes. Once you paint it, it will look perfect!