Fix jpeg support for gd