tidied up coffeescript and made image display better