Learning Discriminative Representations for Gigapixel Images