Update qimage.js

updated to work with requirejs as well.