Project Idea: Self Updating Box that displays thumbnails of photos from a database, allowing user to select one photo as a Primary photo, and also delete photos.

I can easily make a box that gets photos from a Database, but how can I allow the user to star just one primary photo?