Website frappe.ui.dialog Attach upload function

How do I work out frappe.ui.dialog attach image upload in website below is what I have but could not figure out a way to enable the upload

`

let d = new frappe.ui.Dialog({
title: ‘Enter details’,
fields: [
{
label: ‘First Name’,
fieldname: ‘first_name’,
fieldtype: ‘Data’
},
{
label: ‘Last Name’,
fieldname: ‘last_name’,
fieldtype: ‘Data’
},
{
label: ‘Image’,
fieldname: ‘user_image’,
fieldtype: ‘Attach Image’
}
],
primary_action_label: ‘Submit’,
primary_action(values) {
console.log(values);
d.hide();
}
});

d.show();

`
if you look at the images, you will notice the upload is blank. I am on website not desk.