You can hide a keylogger or file in a jpg, it's called steganography. It is useful just for hiding a file,but an exe like a keylogger won't work when the file is run.
A file binder can bind an exe with a jpg into one "container" file. When this file is executed, the pic will show and the exe file will run. But the binded files must be exe to work. MyPic.exe will work. MyPic.jpg will not work