How to Script Gamma Output for Rendered Thumbnails

Im troubleshooting an asset collector script.

Everything works perfectly, but for some reason, although the thumbnails are getting rendered at a 1.8 gamma (which is correct for our studio), the script saves them darker (Im guessing at a 1.0 gamma)

How can I specify in the script to save the image with an override gamma of 1.8?

(Id prefer to specify the gamma rather than relying on "system default gamma" (although system default is 1.8) - Just to be sure!)

Thanks!