Begin tiff to jpg convert, just a wrapper around imagemagick's convert: http://www.imagemagick.org/script/convert.php
Mogrify, really
Get path
format
Aaaaand... MOGRIFY
Remove leftover tiff files