I am trying to show JPG file in a widget "MathPane". After execution of the code below I get "Java heap size" error even though JPG file is very small. I assume I am doing it incorrectly. I will appreciate any help. Import operation is correct, as Print function is working and I can see JPG file in the mathematica console.
displayJPEG[] := Module[{photo},
photo :=
Import["d:/_change requests/_Mathematica \
GUI/p1/beta1/resources/1.jpg"];
Print[photo];
SetPropertyValue[{"plot", "mathCommand"}, photo];
];