prevents gradio frontend process from clogging image output and updates in high throughput scenarios such as LCM with image number >= 4