WMTSTileSource X range

I am using the WMTSTileSource from bokeh to visualize large non-geographical images from a local server, similar to this post. However, I believe something is going wrong with the maximum x range behind the screens. Wider images are being cut short on the x axis, while smaller images get a ‘ghost’ image on the side:
Here you see some tiles suddenly appearing when you zoom in on the empty space next to the image.

Sample code:

x_range = (0, 180000)
y_range = (0, 180000)
p=figure(plot_height = 400,  plot_width = 400, x_range=x_range, y_range=y_range, active_scroll='wheel_zoom',
       toolbar_location = 'right',  tools = 'pan, wheel_zoom, reset')
mytile = WMTSTileSource(url=URL,wrap_around=False,snap_to_zoom=False, tile_size=300, min_zoom=0, max_zoom=5,initial_resolution=512, x_origin_offset=-40000, y_origin_offset=10000)

@SKlerk please always provide a complete Minimal Reproducible Example so that others can actually run code try to reproduce what you are seeing.