I've created a table and on that table I've created a Picture field of type MediaSet.

I do know to place a picture i have to use factboxes on card page

for factbox i have to create a Card Part. So i've created one. I took this code from the source code of "Item Picture".

So the Questions are:
1- Is this right approach ? If yes then how i will upload image in my sandbox environment because on using "File management" codeunit it is showing that it cant be used for extension development.
2- If its not the right approach then what will be the right one to upload a image on a page. So i can read that image using media set.
I just want to upload a image on my card page then want to use that. I cant get the image data form MediaSet picture field because i dont know how to upload the image to the picture field of my table.