Images sitemap generation is accomplished using a crawler that scan your site looking for images to include in your sitemap.
This operation when you have hundreds of links may require several minutes to complete.
In most of the cases the server timeout is set on 30 seconds, and this is the most frequent reason that you get a server error. In the configuration of JSitemap you will find a setting to limit number of requests used to generate images sitemap. Reducing this value can decrease the total time needed to complete sitemap generation and avoid server timeout.