title: rename files with .jpg extension according to its folder name via bash script
body: <p>I have .jpg file in my folder and its sub folders.</p>
  
  <pre><code>image/1/large/imagexyz.jpg 
  image/1/medium/imageabc.jpg
  image/1/small/imagedef.jpg
  </code></pre>
  
  <p>and so on for 2,3,4 ...</p>
  
  <p>I need to rename all image files with its folder name.
  ie. imagexyz.jpg should be large_1.jpg and imageabc.jpg should be medium_1.jpg and so on.</p>