Added update() method to image element JS