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 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.
By default the parameter is set to scan 50 links. You can progressively increase this value if you have more links, trying to generate the sitemap and ensuring that the process completes without server error and timeouts.
Of course this may have the side effect to not scan fully your site and so skipping some links and images. In this case you can better use the advanced AJAX generation and precaching features added in the version 2.3 of JSitemap to have a full images sitemap generated step by step.
In the case that you have dummy or lazy loaded images on your pages, managed for example by gallery plugins, in order to allow the JSitemap Pro crawler to recognize and include them in the images sitemap you must enable the related parameters 'Recognize gallery images' and 'Recognize lazyloaded images'.
In some other cases images could not be embedded in your sitemap because certain hosting providers block, for security reasons, HTTP connections on the same server(named 'loopback' connections). As a result the crawler could be blocked and the images sitemap would be empty, as a result Joomla! could even show an empty error page with a '0' reported. Certain hosting providers could disallow php file open from scripts running on the same server (this is called loopback). Basically the sitemap crawler needs to open socket to URLs of your website and scan them in order to find images. If the response is empty or a captcha page is sent by server the crawler won't work. If your hosting provider is unable to support the proper configuration of the server you won't be able to generate an images sitemap.
The same could happen because of the server ModSecurity configuration, contact your hosting provider reporting the problem and asking for a fix.
Finally, in the case that you are using the plugin JCH Optimize Pro with the option 'Minify HTML' activated and set to 'Ultra' mode, could be the problem. When the HTML is minified the crawler could not be able to find correctly all embedded images in this case change the setting of JCH HTML minification to 'Advanced'.
Another known plugin that totally breaks the server and the images crawler applying an unconventional cache and encoding of the website is the plugin named 'System - RokBooster'. If you have this plugin installed you must disable it before generating an images sitemap, otherwise the server could throw weird errors during the process of crawling the website. If you need a plugin to improve the performance of your website it's recommended to migrate to JCH Optimize that is much more reliable.
If you experiment issues about the images and videos sitemap crawler, you can perform the crawler test to check if it's able to work properly or if it's blocked for some reasons, for example if your hosting provider disallows loopback connections or has a firewall blocking crawlers. In the component configuration you find a button named 'Crawler test' to display the response page given by your server.
If you manage the host file "/etc/hosts" on your server, ensure that the entry pointing to your website domain is present such as: 127.0.0.1 www.yourdomain.com
If the crawler test is successful, you must get your website home page correctly displayed with a HTTP status code '200'.