'If this is the profile image then remove this flag from all
others for this person.'

@staticmethod
def pr_image_onaccept(form):

    form_vars = form.vars
    id = form_vars.id
    profile = form_vars.profile
    url = form_vars.url
    newfilename = form_vars.image_newfilename
    if (profile == 'False'):
        profile = False
    if newfilename:
        _image = form.request_vars.image
        pr_image_modify(_image.file, newfilename, _image.filename, size=(50, 50))
        pr_image_modify(_image.file, newfilename, _image.filename, size=(None, 60))
        pr_image_modify(_image.file, newfilename, _image.filename, size=(160, None))
    if profile:
        db = current.db
        table = db.pr_image
        pe = db((table.id == id)).select(table.pe_id, limitby=(0, 1)).first()
        if pe:
            pe_id = pe.pe_id
            query = ((table.pe_id == pe_id) & (table.id != id))
            db(query).update(profile=False)
