Fixed bug in db upgrade for img.
Fixed bug in db upgrade for img.