validate and fix id and image errors