implement of valid img.