def overlay_image(ax, images, y_pos, x_pos, yx_range, offset, arrowprops=None, cmap=None, vmin=None, vmax=None):
    """
    ax [matplotlib axis]
    images [np.ndarray] of shape [num_images_per_edge, num_images_per_edge, channels, height, weidth] images for each mesh point
    """
    num_images_per_edge = images.shape[0]
    image_y_pos = data_utils.remap_axis_index_to_dataset_index(
        axis_index=y_pos,
        axis_min=yx_range[0][0],
        axis_max=yx_range[0][1],
        num_images=num_images_per_edge)
    image_x_pos = data_utils.remap_axis_index_to_dataset_index(
        axis_index=x_pos,
        axis_min=yx_range[1][0],
        axis_max=yx_range[1][1],
        num_images=num_images_per_edge)
    height_ratio = images.shape[3] / np.maximum(*images.shape[3:])
    width_ratio = images.shape[4] / np.maximum(*images.shape[3:])
    inset_height = 0.35 * height_ratio
    inset_width = 0.35 * width_ratio
    arr_img = np.squeeze(images[image_y_pos, image_x_pos, ...].transpose((1,2,0)))
    imagebox = OffsetImage(arr_img, zoom=0.75, cmap=cmap)
    img = imagebox.get_children()[0]
    img.set_clim(vmin=vmin, vmax=vmax)
    imagebox.image.axes = ax
    if arrowprops is None:
        arrowprops = dict(
            linestyle='--',
            lw=1,
            arrowstyle='->',
            color='r'
        )
    ab = AnnotationBbox(imagebox,
        xy=[x_pos, y_pos],
        xybox=offset,
        xycoords=ax.transData,
        boxcoords='offset points',
        pad=0.0,
        arrowprops=arrowprops
    )
    ax.add_artist(ab)
    return arr_img