Consistent representation via contrastive learning for skin lesion diagnosis