Fix Zoom box resizing when it's hidden when the viewer loads (issue 5224)

Attempting to fix #5224.

@fkaelberer Can you please confirm if this patch fixes the issue?