If you’re new the first step is to learn the programming guide and CUDA manual. Don’t just skim it, really learn it. Then, look through the example code provided in the SDK for various projects, and read the documentation that comes with them. Some of the examples provide very highly-tuned algorithms for certain problems, and you will get a good working knowledge of the optimizations needed to harness the full potential of the GPU.
After that, you’ll want to read up on the JPEG algorithm, how it’s implemented, and so on. By that point, you should be able to figure out how to complete your JPEG project on your own.
Note: If I were you, I’d also stick around on the forums, even just to read the posts by people who are really good with CUDA. I’ve learned a great deal about CUDA just by reading through the forums every day.