fix ImageField related bugs