Images taken with wide-angle cameras tend to have severe distortions which pull points towards the optical center. This causes the visual appearance of an object to vary drastically with its location in the field of view.
Photoshop's lens correction tool can remove this distortion for you. Depending on the camera you used Photoshop can read the exif data (EXIF (Exchange image file format). This is a standard that allows information stored with the digital photograph) and automatically make the corrections for you.
If not, you can select your camera make and lens to remove this distortion.
To find this filter in CS5 go to Filter - Lens Correction. (In previous versions of Photoshop it was hidden under Filter - Distort - Lens Correction) Never have issues with "bent walls" again.
Here is a video of Lens Correction in action!