Added image validation