Added system availability check for libjpeg.

Commit this change before continue work with other libraries to discuss if the approach is fine.