added test if there are no white pixels