Add a Upload Image type in Dialog Box

Can we add a Image button to upload an image in Dialog Control, i am trying to add a image in “Item Group” doctype inside Sales_browser Doctype.
I am facing issue with form and the image is not storing to public/files folder and its not form so its giving error while refresh function is called. and even onchange event is generating on change of image in “image” fieldtype.

Please check this, it will work.