Thanks for replying Ravi.
I tried the link which you have referred but I couldn't drop any images.
Moreover I was using sling:resourceType: cq/gui/components/authoring/dialog/fileupload.
I tried using sling:resourceType="granite/ui/components/foundation/form/fileupload" but seems like even it didn't work.