fixed issue on safari drawImage indexsizeerror