added image type validation