Just copying code over from L3 version with no attempt (yet) to make it compatible
Using composer to install phpthumb