I'm not particularly fluent with SQL but what if you try:
$gallery_stats->query("SELECT DISTINCT A.user_id, B.name, COUNT( A.user_id ) AS `text`
FROM a_images, b_members
WHERE A.user_id=B.id
AND image_date > '$thismonth'
GROUP BY user_id
ORDER BY `text` DESC
LIMIT 0 , 10");
btw, be careful when using text as an alias since text is also a column type.