// image 1
byte[] data1 = MagjaFileUtils
.getBytesFromFileURL("http://www.rockstore.com.br/store/catalog/co356.jpg");
Media image1 = new Media();
image1.setName("guevara");
image1.setMime("image/jpeg");
image1.setData(data1);
Set<ProductMedia.Type> types1 = new HashSet<ProductMedia.Type>();
types1.add(ProductMedia.Type.IMAGE);
ProductMedia prd_media1 = new ProductMedia();
prd_media1.setExclude(false);
prd_media1.setImage(image1);
prd_media1.setLabel("Image for Product");
prd_media1.setPosition(1);
prd_media1.setTypes(types1);
product.addMedia(prd_media1);
byte[] data2 = MagjaFileUtils
.getBytesFromFileURL("http://www.rockstore.com.br/store/catalog/co356_foto.jpg");
Media image2 = new Media();
image2.setName("guevara");
image2.setMime("image/jpeg");
image2.setData(data2);
Set<ProductMedia.Type> types2 = new HashSet<ProductMedia.Type>();
types2.add(ProductMedia.Type.SMALL_IMAGE);
ProductMedia prd_media2 = new ProductMedia();