A picture or photo in your PC can have different file extensions, such as jpeg, bmp, etc. These photos and pictures are a soft target for stenography programmers looking to infect a large database. It involves concealing data in different means, like in pictures, audio, or even concealed backdrop disturbance such as radio waves. You cannot receive or send viruses through images that include jpegs, .gifs, etc. but can you send or receive viruses through executable files like .exe, .scrg, etc. More information below.
A JPEG is a file that can get infected. However, in order to activate the virus, the file must be run. As the JPEG file is an image file, it will not be executed as long as the image is not processed by any other type of program. Therefore, if the image is executed by a program like a library or a database, the system can get infected.
You can find more information about this issue on the Secure Works site.