Update slimmage.js

Make slimmage more compatible with competing javascript