Made cmake check that libpng and libjpeg actually contain the link symbols they
are supposed to since, on some systems, these libraries aren't installed
correctly and will cause linker errors if used.