Added the capability to return a base64 PNG image instead of canvas