bugzid:4305 move image validation to static function