fix bugs as loading images