added image validation