Update image x,y,dw,dh or figure x_range,y_range

I’m wanting to be able to change the image in a figure based on new data the user selects. Using bokeh server.

Lets say I want to start my script with an empty figure:
simage = ColumnDataSource(x=,y=,image=)
p = figure(plot_width=512,plot_height=512)
p.image(image=‘image’,source=simage,x=0,y=0,dw=1,dh=1)

``

Now the user inputs a new file to upload data from. I want the user to be able to switch files, which may have different data sizes. I know I need to update simage with the new data, but how do I update the image with the correct x,y,dw,dh, or the figure x_range and y_range?

f = np.load(‘data.npz’)
simage.data = dict(x=[f[‘x’]], y=[f[‘y’]], image=[f[‘image’]])
#??? How to update p???

``