Update rimg.js

More strictness in conditional statements
Merge pull request #7 from Hekman/master

Update rimg.js formatting