Mysql INSERT INTO .. ON DUPLICATE KEY UPDATE
Use UPDATE image_count = VALUES(image_count). 

VALUES() expects a name from the columns you are inserting into, not the alias in the query. The query should be:

INSERT INTO countingTable (image_count, article_id) 

SELECT COUNT(article_id) AS sum, article_id
FROM imageTable 
GROUP BY article_id                  -- I suppose you skipped that line?

ON DUPLICATE  KEY UPDATE image_count = VALUES(image_count) ;


If you want the new values to be added to the existing ones, use:

...
ON DUPLICATE  KEY UPDATE image_count = image_count + VALUES(image_count) ;