Unnecessary pan_and_zoom calls:
Added Math.abs tolerance in viewport_size_not_changed.
Reduces lag/flicker on small viewport changes.
Incorrect previous viewport height:
Fixed assignment of previous_viewport_h = viewportHeight.
Ensures correct pan/zoom on height changes, especially on mobile.
Loader hides too early:
Use of self closure + startIfNotStarted ensures panel only starts after image loads.
Prevents loader from disappearing before background image is ready.