At workstation no IME is available, so I type in English, but it's easy :p
==========================================
The USE set of php varies from version to version.
My newly emerged php-5.2.4 does not have the jpeg flag either. But through php-config, it shows php is linked to ljpeg, so it seems jpeg support enabled on my box.
There's no jpg or jpeg in the ebuild. So I think it is a builtin in this version.
Perhaps you can emerge php first and check out if jpeg support is enabled.
The following is my emerge -pv php.
takao ~ # emerge -pv php
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] dev-lang/php-5.2.4 USE="apache2 berkdb bzip2 cjk cli crypt exif ftp gd gdbm iconv kerberos ldap mysql ncurses nls pcre pic postgres readline reflection session snmp spell spl sqlite ssl threads truetype unicode xml zip zlib (-adabas) -bcmath (-birdstep) -calendar -cdb -cgi -concurrentmodphp -ctype -curl -curlwrappers -db2 -dbase (-dbmaker) -debug -discard-path -doc (-empress) (-empress-bcs) (-esoob) -fastbuild (-fdftk) -filter (-firebird) -flatfile -force-cgi-redirect (-frontbase) -gd-external -gmp -hash -imap -inifile -interbase -iodbc -ipv6 -java-external -json -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pdo-external -posix -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -soap -sockets (-solid) -suhosin (-sybase) (-sybase-ct) -sysvipc -tidy -tokenizer -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip-external" 0 kB