Rewrite image plugin in coffeescript