if you have the images table:
1 orange.jpg
2 apple.jpg
3 plane.jpg
then save the votes in a votes table:
image_id , session_id , vote
1 , 0000000000000000 , spoon
2 , 0000000000000000 , folk
3 , 0000000000000000 , something
mysql has features to define unique key for determined fields, such as:
image_id + session_id + vote must have been unique. So i can't select spoon twice for the images.
how to solve that the user cannot vote with the same answer, set another unique key for the sessionID and vote, if the user gives the same answer you will get duplicate entry error after your INSERT command. But something is wrong here. If a user gives another vote with the spoon, this cause error. The mentioned definition table could solve this problem.
the user add the votes, press the submit button, and you fill the imageID 's into the definition table.
definition table:
def_id , image1_id , image2_id , image2_id
you will get the new def_id with the mysql_insert_id()
Take a new field into the votes table, called: def_id
Now votes looks like:
def_id , image_id , session_id , vote
1 , 1 , 0000000000000000 , spoon
1 , 2 , 0000000000000000 , folk
1 , 3 , 0000000000000000 , something
if you set unique to the def_id + session_id + vote fields, if the user gives the same vote for that random list, that will cause DUplicate Entry error on Insert, and you can make an error message, try to give another answer, and delete the inserted votes.
This idea might gives you better ideas how to solve this problem. Notice that, this is a half solution only. If you want to build a vote system for unlimited items, you should build a norlamized table structure for the defintions table.