             # get the new sha1 hashes
             (cb) =>
                 @_exec
-                    command : "sha1sum *.png"
+                    command : "sha1sum *.png *.jpg"
                     bash    : true
                     path    : "#{@path}/#{tmp}"
                     cb      : (err, output) =>

        opts = defaults opts,
            project_id : required
            filename   : required
        @project_id = opts.project_id
        @filename   = opts.filename
        
        @_pages     = {}
        @num_pages  = 0

        # for now... for debugging.
        @_text = text

    # Updates previews for a given range of pages.
    # This computes images on backend, and fills in the sha1 hashes of @pages.
    # If any sha1 hash changes from what was already there, it gets temporary
    # url for that file.
    # It assumes the pdf files is there already, and doesn't run pdflatex.
    update_images: (opts={}) =>
        opts = defaults opts,
            first_page : 1
            last_page  : undefined  # defaults to @num_pages, unless 0 in which case 99999
            cb         : undefined  # cb(err, [array of page numbers of pages that changed])
            resolution : '50'      # 'number' or 'number1xnumber2'
            device     : '16m'      # one of '16', '16m', '256', '48', 'alpha', 'gray', 'mono'  (ignored if image_type='jpg')
            png_downscale  : 2      # ignored if image type is jpg
            jpeg_quality   : 75     # jpg only -- scale of 1 to 100  

        if not opts.last_page?
            opts.last_page = @num_pages
