Moodle 23 stable

Dear Julian,

This pull request fixes inadvertent application of Moodle 2.4 code and back ports the PNG transparency code from 2.4.

Cheers,

Gareth