How does the gas fee determined? Does it depend on the type or size of the jpeg?
Depends on the smart contract, but ultimately it's the data you're paying for I believe. You're not actually buying a file format, but the representation of it within the contract. At least that's my understanding, and why digital art has much higher fees than say lower resolution digital collectibles.
The minting costs of hashmasks supports this theory at least.