This feature is now built-in to Discourse core, see the announcement regarding image grids in Discourse.