Javascript image preload by scrolling (writting as YUI3 widget)