removing invalid image