fixed update function for images