fixed a bug in loading the images