Forum:Image count

I'm looking for a script, that would count the number of images in galleries on a given page, and then prepend a template (preferably with a name I can pick) with a parameter that contains the number of images. For example, which would show "There are 60 images in galleries on this page". Then, I'd run this on every page inside a category specified by me. Vengir (talk) 09:23, May 16, 2014 (UTC)