Make import of images display up to four previews, rewrite into coffeescript