Making both JPG and EPS file extensions work with Latex:

1. Add these lines to the top of the latex file:

\newif\ifpdf\ifx\pdfoutput\undefined\pdffalse\else\pdfoutput=1\pdftrue\fi
\newcommand{\pdfgraphics}{\ifpdf\DeclareGraphicsExtensions{.pdf,.jpg}\fi}
\usepackage{graphicx}

2. Then make sure you have both .jpg and .eps versions of all graphics. JPGs can be converted to EPSs using the UNIX program linked here, jpeg2eps.

3. Finally, whenever graphics are included, omit the file extension like this:

\includegraphics{figure1}
and NOT like this:
\includegraphics{figure1.eps}

This way, when latex is compiling your file, it will look for a .eps file to include, and will locate figure1.eps; when pdflatex is compiling it, it will look for a .jpg file to include, and will locate figure1.jpg. Both should compile successfully.

Addendum: this doesn't seem to work with Miktex: Miktex automatically goes pdf; the two lines starting with newif and newcommand need to be commented out for Miktex to still produce .dvi output. Otherwise this seems to work.


Sources:
Latex, pdflatex
JPG to EPS conversion, jpeg2eps