Update rimg.js

More strictness in conditional statements