Try this. I had the same problem, we dealt with the height, but not the width.
def flip(picture):
width = getWidth(picture)
height = getHeight(picture)
for y in range(0, height/2):
for x in range(0, width):
**p1 = getPixel(picture, width - 1 - x, y)**
p2 = getPixel(picture, x, height - 1 - y,)
color = getColor(p1)
setColor(p1, getColor(p2))
setColor(p2, color)