fixed the error when trying to update to a new img