Supervised Contrastive Learning for Few-Shot AI-Generated Image Detection and Attribution