image generation fixes, thanks to <berny156 at gmx.de> (#2379)