def _frame_image(image, frame, left_margin, top_margin):
    """
    Fix the image in the frame with the specified spacing
    :param image: the image to frame
    :param frame: the frame in which to fit the image
    :param left_margin: the margin to the left of the image
    :param top_margin: the margin to the top of the image
    :return: the framed image
    """

    frame.paste(image, (left_margin, top_margin))
    return frame