removed unnecessary cased from the remove bad img if statement