I think, ofcourse, you know what actually the error is:
that your program is not able to locate where the image lies, that's why it's resulting in a null.
Try this thing once:
keep image any where you want and in the createimage function pass the full path of that particular image.
Like save it on desktop and instead of " x = Image.createImage("/1.jpg"); "
use " x = Image.createImage("/Home/Stranger/Desktop/1.jpg"); "
Then let us know, if still there's any problem.