add try catch for drawImage method
update build