added image validation to solution