How can I retrieve photos from a damaged iPhone 3GS?
We may need a bit more information, but some suggestions...

First, I assume you've checked that the photos were never imported onto a computer in any way? Obviously this would make retrieval unnecessary if they have been copied to a computer/hard drive, imported into iPhoto/Picasa/etc... but I guess that hasn't happened in the last 4 months...?

Was iCloud Photostream turned on? You may be able to directly access the last 30 days worth of photos already, via iCloud or software that supports Photostream.

Was DropBox installed on the phone? DropBox has a Camera Import feature, which, if turned on, backs up your camera roll photos to your dropbox account.

Was the phone setup to backup to iCloud? You may simply be able to restore another iPhone from the backup, getting all photos from the camera roll back (assuming a complete backup; though if there's a lot of photos it may have gone over the free 5GB limit).

Was it set to backup to iTunes? If it's recently been backed up, you can also restore another iPhone from the backup.

Does the phone still power up? This is hard to tell if the screen is broken, but if it shows up on a computer when plugged in via USB then you may be able to recover information over USB. In that case you could use iExplore to access the contents of the phone. I believe iExplore can also browse an iTunes backup. And if it does work, this would be a good time to ensure you take a backup.

If all answers are no, then you would want to find an iPhone repair shop. Apple themselves may be able to do this. There are limits, however. If the memory chip itself is damaged, the data will be lost. The iPhone data is also encrypted using an encryption key, and I'm not sure whether this relies on any hardware components or if it's purely in software—if the key is derived from the main board or some other chip on in the phone (not just a software key) then you would need all relevant parts to be still functional to retrieve the data. This is something Apple or a repairer will be able to tell you.