Changed user field to user_id and added unique constraint
Now uses im.user's images
Refactored to avoid user duplication problem
Solved a few bugs
merge trunk
[FIX] im: multiple bugs