Resize images according to screen resolution

Hi All!
I have a web application with an asp:panel, users can add images, the program automatically make the thumbnail. when user click on thumbnail they can see a pop up modal page.

Images are in different sizes, so what I need to achieve is to get the screen resolution or browser visible area and re-size the image according to this resolution. (users could have different type of computer screen with different resolution), I need a JavaScript or jquery code.

Thanks in advance

If you are using a img tag to render the image into, then why not use something like this:

img { width: 100%; }