Moved jpeg image decoder code from main to jpeg specific file