Hello @meemer,
Thanks for your contribution to the community. I hope it will help other users having a similar query.
You can give it a try to the code mentioned in the first reply here if that helps - Pictures not show in a grid format in activity
Thanks.