Add test for IsValidImage