I can only get the program to run on certain images. Does not work (error code 1): filename: noise.jpg  Works but produces output with incorrect file extension: filename: test.png (output file is a jpg with .png extension) 
I can only get the program to run on certain images.
Does not work (error code 1):

filename: noise.jpg
Works but produces output with incorrect file extension:

filename: test.png (output file is a jpg with .png extension)