Added error checking for PIL, warning message