When I save the attached JPG using 3.510.4297.28964, it takes 642KB.
Maybe you have a problem in your compression routines?
I of course already saved the image using another program and it became 2KB, I'm just reporting this so you can look into any bugs you may have in your code.
Keep up the good work