Fixed the query for last avatar and fixed to correctly save avatar and voter