Added jpegcam and fixing some details of the code