Updated bg_remove function

-Consistent pixel calculations by rerunning bwperim and imfill