Managing picture

Hi everybody, I need your help!

I'm doing a plugin with a simple form and it all works. Right now I want to add an image upload to the form.

I have written this code and actually it's possible to see a upload form inside the main form:

 <label><?php echo elgg_echo("Upload an image"); ?></label><br />
    <?php echo elgg_view('input/file',array('name' => 'image')); ?>

What I need to know is how to manage the file (jpeg) which I'm going to upload in order to have a correct visualization of it. I have tried usign the classic way (ouput/file) but this doesn't work. I'm pretty sure there is no error in code because I have managed the output like all the other working output. I think that there is another way to manage this kind of output in order to get a small thumbnail of the image.