JPEG files contain compressed image data that do not have any elements running as a program code. A keylogger malware could perhaps be transmitted through a file masked as a photo file or through program bugs. When running fake JPEG files, there is a chance of them becoming executable files like .exe, .msi and others. Any media file may contain injected code designed to deceive specific applications, so it is best to check the extensions before opening a file as a precaution.