I'm managing a store with a large inventory of products that we have to add dynamically through the Shopify API. The products that I'm adding in the API have multiple variants each with their own image that I want to associate it with during creation. I understand that through the Admin REST API, we aren't able to do this with just one API call. So I've been making do with making 2 calls, one to create the products, variants and images, and the other to link the images to the appropriate variants.
However to do this, I need to match up the filenames of our variant images with the new ones that Shopify creates. The problem I'm seeing is that for some images that we upload to Shopify, the API modifies them in ways that aren't expected.