Image resize in apex using html 5 canvas