view.js: Switched to a sprite instead of single images; Improved the handling of sprite.onload.