allow user to delete image from database

i would like to have a delete button on images uploaded by the user. Can do this by setting the image value in a dataset to null?

export function deleteImage1_click(event, $w) {
        $w('#dataset1').setFieldValue('image1', $w('#image1').value(null));
}

#database #dataset #image #null