There are 2 ways to pack:
https://esotericsoftware.com/spine-texture-packer#Packing
When packing during data export, the Attachments
setting only packs used images. Otherwise, all images in the input folder given to the texture packer are packed -- often that is done when packing images for multiple skeletons together in a single atlas.
Ideally you keep your images folders clean, so they don't contain images you don't need. If you have very messy image folders and you are packing the image folders, you could temporarily use Attachments
packing, then unpack your atlas to get individual files again so you have only images that are used. You can do that for each skeleton to rebuild your images folders so they only contain images that are actually used. When doing that, don't pack with PMA, else unpacking can have data loss in some cases.