solved a problem in loading images in canvas