adding image buffering logic to images.js and updating ngWidApp.js