Fix implicit globals Fixes lathropd/reflowjs#14
Code whitespace cleanup
Fix bgImage scope issue

It broke because `img` is no longer global.