Another way to fix this is with a built in filter to Photoshop... filters/distort/len correction. You can fix horizontal and vertical perspective distortion and any combination of both at the same time... AND you can fix barrel or pincushion distortion. Keep in mind though, as with any editing you do in JPEG mode, you risk destroying pixel data so your results (while probably quite acceptable) will never be optimal... with either method. The best way to correctly capture images of subjects while pointing up is with a T/S lens if you want true perspective.
Here's an example of a lens distortion adjustment that I made with the lens correction filter. You can see how extreme the problem was and the results yielded.
HOSTED PHOTO
please log in to view hosted photos in full size.
HOSTED PHOTO
please log in to view hosted photos in full size.