def save_image_pixels(session, localfile, image_tags=None):
    """
        put a local image on the server and return the URL
        to the METADATA XML record

        @param: session - the local session
        @param: image - an BQImage object
        @param: localfile - a file-like object or name of a localfile

        @return: XML content when upload ok
    """
    xml = None
    if image_tags:
        xml = session.factory.to_string(image_tags)
    return session.postblob(localfile, xml=xml)
