Out-of-Distribution Generalization of Gigapixel Image Representation