Something to consider, is to possibly do some math to figure out the dominant pixel color (background). This will save you from running into issues where you set it to look for pure white... but its a off white instead...
but like i said, scan the image, make sure theres XX wide of open space, and XX high of the same space...
If you only do wide, it might put a image in the line breaks.