fix small bug in pre-loading images