add an image preloading fn