File name to 7z

how to compress "file name1.jpg ,file name2.jpg file name3.jpg ?
so... eath fle ends up in it own .7z file based on filename without exstantion

so you end up with

file name1.7z
file name2.7z
file name3.7z

i know i can do this one at a time but have 20000 + files to do

would also be great if i could remove file name1.jpg at the end just have the compressed .7z files left at the end