title: How to rewrite URLs using htaccess only for images
body: <p>This is the current URL of my images -</p>
  
  <pre><code>http://www.mysite.com/files/thumb/133/595
  </code></pre>
  
  <p>While inspecting it in firebug, this is the code under image tag -</p>
  
  <pre><code>&lt;img src="http://www.mysite.com/files/thumb/133/595" alt="This is text"&gt;
  </code></pre>
  
  <p>Now i want the above URLs to be changed like this -</p>
  
  <pre><code>http://www.mysite.com/files/thumb/133/595/This-is-text.jpg
  </code></pre>
  
  <p>Image extension(<code>.jpg</code> in this case) added automatically on the type of image and alt text is added to the link with space being replaced from <code>-</code>.</p>
  
  <p>How can i achieve this? via <code>htaccess</code> or some other method( project is in <code>php</code>).</p>
  
  <p>How to rewrite my htaccess file that this change will only take place for images only.(Newbie in re-writing).</p>