Note: changing the extension here is unnecessary. $output_file is taken from item->thumb_path() which, for a movie, is already jpg.  If the rename were necessary here, we'd have a whole different set of problems...