repair bug when images are not loaded