write  image error event in errorHandling.js