Could you post an example result image containing these lines?
You could try to specify an interpolation method in im.thumbnail e.g. as Image.ANTIALIAS, but your current issue seems to be more significant than a quality issue.
PS: as this seems to be PIL specific, you might get a faster and better answer on e.g. StackOverflow