I was trying to think how tinyurl does it with just the website name and path, like
http://www.pix01.com/12345. Now let me preface this by saying that I have only worked with the Windows environment and not PHP/Unix/etc.
The first thing of course is coming up with a "tinyurl" number. You need to make it unique somehow because otherwise somebody can start entering numbers sequentially to see people's albums that might have set them private. Maybe the base 62 does this or mixing it with the user's login info. So you get the unique number and store it in the database with the URL.
Now as far as getting that unique number out of the database, you create a custom 404 error page (page not found). This is possible in Windows servers with ASP and I assume in Unix/PHP although I see pix01 doesn't have one yet so maybe not. Anyways on the 404 error page, you would get the number if it was only in the format of
http://www.pix01.com/12345, search the database for 12345 and if found, redirect to the URL. If it's not in the database, then you would just put up your normal page not found error message.