Image preloader for canvas game programming