How do lenses magnify images? Using the ray model of light helps us to model what happens when a ray of light enters in to the lens. right? but doesn't tell us how? 

As you can see in this image the rays of light are converging to form a smaller or a bigger image. but what does really happen. To make my question clear let me give you an example. if give a computer scientist a 4 by 4 pixel image and ask him to enlarge by a factor of two, what he would do is make an 8 by 8 pixel image and fill every 2 pixel the color of the one pixel in the older image. By the same logic what do lenses do, do they increase the number of photons that are reflected from the object,(which sounds wrong, but to just give you what kind of answer i am looking for).   
 A: A magnifying glass or a loupe works by allowing you to view the object at a closer distance.
Normally, the eye has its near point at about 25 cm. Closer than that it goes out of focus. But with a lens, you can put it at the focal distance of the lens and the eye can view it without any strain.
So the magnifying power is given as
$$ M = \frac{25\ {\rm cm}}{f},$$ 
where $f$ is the focal length of the lens.
This image illustrates the angular magnification by a lens (the object is a bit closer than the focal length, the rays are slightly diverging after the lens):

A: Lenses do not increase the number of photons. They are optical transparent. Lenses deflect the incoming EM wave.
EDIT:
In case for the virtual image the light waves from the object ('Objekt' in the image below) that pass through the middle of the lens do not get deflected and those rays who are passing above are getting deflected. For the viewer who is standing right of the lens the rays are following a linear path and it seems that the light is coming from the virtual image ('Virtuelles Bild' in the image below) where both rays meet. So the viewer gets a scaled up virtual image and he can accomodate it from a shorter distance. 

A: 
To make my question clear let me give you an example. if give a
  computer scientist a 4 by 4 pixel image and ask him to enlarge by a
  factor of two, what he would do is make an 8 by 8 pixel image and fill
  every 2 pixel the color of the one pixel in the older image. By the
  same logic what do lenses do,

Ultimately, the same thing.
The back of your eye, the retina, consists of many microscopic sensors. Images look "bigger" when they fall on more of these sensors. The optic nerve and brain are the parts that give things "size".
So when you enlarge an image on the computer, you are making it physically larger so it spans more of your retina when you look at it. The optic system then says it's "bigger".
When you look through a lens, the image is being spread out. So instead of it falling on a small number of sensors, it falls on more of them. Once again, the brain says "bigger".
Consider Case VI in your images. In this we have a small object being viewed through a lens. If the rays from A and B went right into your eye you would get a small number of sensors being hit and you would say "small". But if you follow the rays after they come out of the lens, you can see that they are spread out. So, in that case, they would hit more sensors, and look larger.
Note that these diagrams also show why you need to hold a magnifying glass close to the object you're looking at.
