Intermediate Inputs, Firm Heterogeneity and Gains From International Trade