Letting a user choose pictures

What's exactly the question?

You have images, records with information about those images (path,
and all you need to do is show a list with this information.

Just get the image records as you would do with any other kind of
Paginate if necessary and then display in a list or table.
(You may want to use thumbnails instead of fullsized images)
Main difference is that you have an additional image tag or link to
click the image for selecting it. (I would make that an Ajax response)

Then you action gets the images id (and user id or whatever)
and can assign it to any other subset or blogentry or whatever
you want to do with it.

Have a look at this site: www.nationalebeeldbank.nl

It's doing something on that line, querying images with sphinx
and allow to add them to a cart or view the fullsize version.
(No need to create a user, searching images works without

A user can upload an arbitrary number of images to the site and then
there's a section where they can create topics for forums of the site.
I would like the user to be able to select images from this list and
attach them to a topic and I'm not sure of how to design the UI for