You likely have HomeBrew installed (or something like it). Something is setting DYLD_LIBRARY_PATH to /usr/local/lib first and you get a collision with Jpeg installed in /usr/local/lib/libJPEG.dylib instead of using the system version.
The (wrongly demoted) answer given by @Pierz above is correct.