Setting Base 64 image data to docType image field for preview

Hi team,
Trying to set the base 64 encoded image data to a doctype field which is an image type. I’m trying to set it this up using the client side script.

Here is my script:

frappe.ui.form.on('test', {
    onload(frm) {
        console.log("Paramesh...");
        var image_base64_data = 'data:image/png;base64,Qk0uuvf39/f39vb29fb39vb39/f39/f39/f39/f39/f39/b39/b29vb39vb29vb29/b29vb29fX08/Ly8fLy8/P09fX29fb29fb29fX19fX29fX29fb29vb29vb29vb19vb29fX29vb29vf29vb29vb29vb19vb29fb29/b29vb29vb18/Hw8fHy9PX19vb19fX29vb29/b29vb39/b29/f29vf29vb29vX19/f29vb39vb29vb19fX19fX29vb39vb29vb19vf19vb29vb29/f39vf39/f29/f3+Pj3+Pj49/f4+Pj4+fj4+Pn5+fn5+fn5+fn5+fr5+fn5+fj5+g=='
        
        // Set the image data to the 'test_image' field
        console.log("Setting test_image field...");
        frm.set_value('test_image', image_base64_data);
        
        // Set other fields as needed
        frm.doc.name1 = 'Nalla';
        console.log("Setting name1 field...");
        
        // Refresh other fields
        frm.refresh_field('name1');
        frm.refresh_field('test_image');

        console.log("After Field Value:", frm.doc.test_image);
    }
});

Logs prints data is set correctly on the field but still image is not showing for preview. Verified Base64 data is correct and able to convert to image successfully.

DocType: {"name":"test","creation":"2023-12-21 08:08:17.664061","modified":"2023-12-21 08:09:34.813597","modified_by":"Administrator","owner":"Administrator","docstatus":0,"idx":0,"issingle":0,"is_tree":0,"istable":0,"editable_grid":0,"track_changes":0,"module":"Custom","naming_rule":"","sort_field":"modified","sort_order":"DESC","read_only":0,"in_create":0,"allow_copy":0,"allow_rename":1,"allow_import":0,"hide_toolbar":0,"track_seen":0,"max_attachments":0,"document_type":"","engine":"InnoDB","is_submittable":0,"show_name_in_global_search":0,"custom":0,"beta":0,"has_web_view":0,"allow_guest_to_view":0,"email_append_to":0,"show_title_field_in_link":0,"translated_doctype":0,"is_calendar_and_gantt":0,"quick_entry":0,"track_views":0,"is_virtual":0,"queue_in_background":0,"allow_events_in_timeline":0,"allow_auto_repeat":0,"make_attachments_public":0,"force_re_route_to_default_view":0,"show_preview_popup":0,"index_web_pages_for_search":1,"doctype":"DocType","permissions":[{"name":"6b6891e3cb","creation":"2023-12-21 08:08:17.664061","modified":"2023-12-21 08:09:34.813597","modified_by":"Administrator","owner":"Administrator","docstatus":0,"parent":"test","parentfield":"permissions","parenttype":"DocType","idx":1,"permlevel":0,"role":"System Manager","read":1,"write":1,"create":1,"submit":0,"cancel":0,"delete":1,"amend":0,"report":1,"export":1,"import":0,"share":1,"print":1,"email":1,"if_owner":0,"select":0,"doctype":"DocPerm"}],"states":[],"fields":[{"name":"258e100156","creation":"2023-12-21 08:08:17.664061","modified":"2023-12-21 08:09:34.813597","modified_by":"Administrator","owner":"Administrator","docstatus":0,"parent":"test","parentfield":"fields","parenttype":"DocType","idx":1,"fieldname":"test_image","label":"Test Image","fieldtype":"Image","search_index":0,"show_dashboard":0,"hidden":0,"set_only_once":0,"allow_in_quick_entry":0,"print_hide":0,"report_hide":0,"reqd":0,"bold":0,"in_global_search":0,"collapsible":0,"unique":0,"no_copy":0,"allow_on_submit":0,"show_preview_popup":0,"permlevel":0,"ignore_user_permissions":0,"columns":0,"default":"","in_list_view":0,"fetch_if_empty":0,"in_filter":0,"remember_last_selected_value":0,"ignore_xss_filter":0,"print_hide_if_no_value":0,"allow_bulk_edit":0,"in_standard_filter":0,"in_preview":0,"read_only":0,"precision":"","length":0,"translatable":0,"hide_border":0,"hide_days":0,"hide_seconds":0,"non_negative":0,"is_virtual":0,"sort_options":0,"doctype":"DocField"},{"name":"f95f596b66","creation":"2023-12-21 08:08:17.664061","modified":"2023-12-21 08:09:34.813597","modified_by":"Administrator","owner":"Administrator","docstatus":0,"parent":"test","parentfield":"fields","parenttype":"DocType","idx":2,"fieldname":"name1","label":"Name","fieldtype":"Data","search_index":0,"show_dashboard":0,"hidden":0,"set_only_once":0,"allow_in_quick_entry":0,"print_hide":0,"report_hide":0,"reqd":0,"bold":0,"in_global_search":0,"collapsible":0,"unique":0,"no_copy":0,"allow_on_submit":0,"show_preview_popup":0,"permlevel":0,"ignore_user_permissions":0,"columns":0,"in_list_view":0,"fetch_if_empty":0,"in_filter":0,"remember_last_selected_value":0,"ignore_xss_filter":0,"print_hide_if_no_value":0,"allow_bulk_edit":0,"in_standard_filter":0,"in_preview":0,"read_only":0,"precision":"","length":0,"translatable":0,"hide_border":0,"hide_days":0,"hide_seconds":0,"non_negative":0,"is_virtual":0,"sort_options":0,"doctype":"DocField"}],"links":[],"actions":[],"__last_sync_on":"2023-12-21T03:40:24.154Z","__unsaved":0}

Please help me out.