make a slightly simpler image-logic. Introduce js