Updating text and checking if alt field is not undefined