How can malware be attached in image files such as a JPEG image?
The most common attack method with attaching malware to an image file (or any file for that matter) is to hide an executable file with a different file extension.
For example in your case, a victim might think he is downloading the file
wallpaper.jpg when in reality he is downloading the file
wallpaper.exe that has been renamed with the JPEG file extension.
The most simple way would be if a person doesn't have "show files extensions" option checked, then you can name your exe file like "house.jpg" (that is the name, so basically it is house.jpg.exe). You can't use regular dot from the keyboard tho, you need to find special dot in the table of characters. I know that this isn't the answer for your question, but it could help.