Left shift replaced with more obvious Math.floor; Better coding style in preloadImages