configure: detect and use jpeg library