rectified some errors in loading images