Move working extract-jpeg.rb from gist