fixed bug with image preload