OK, I'll assume you have an image table, and a vote table. A row in the vote table represents a single vote cast with the score that was given. (Figuring out multiple votes is easy, use cookies, user_ids, etc.)
table: image
image_id int4
name vc
table: image_votes
image_id int4 fk to image
score int4
your query is:
select sum(v.score) as total_votes,
count(v.score) as votes_cast,
i.name from image_votes v, image i
where i.image_id = v.image_id
group by i.name;
Better yet, just create a view to the data:
create view as
select sum(v.score) as total_votes,
count(v.score) as votes_cast,
i.name from image_votes v, image i
where i.image_id = v.image_id
group by i.name;