Unobserved heterogeneity in the productivity distribution and gains from trade