You need to use elif for your second conditional, not just if. If I role-play as your computer real quick with my self.rect.x value to something less than zero, this is what I say:
if (self.rect.x < 0):
self.rect.x = SCREEN_WIDTH
Oh, OK! self.rect.x is less than zero, so I'll set it equal to SCREEN_WIDTH! Onward to the next line!
The solution in my case was simple, check if the tile is 'None'. If yes, then pass it, but if not, transform it to a larger size. This is the full code that should be used:
def __init__(self, filename):
tm = pytmx.load_pygame(filename, pixelalpha=True)
self.width = tm.width * tm.tilewidth
self.height = tm.height * ...