title: Sortable image gallery
body: <p>I want to create a sortable image gallery using Jquery UI Sortable. Until here, works fine.</p>
  
  <p>Inside each tag, I need to store the order of each image in the gallery. But this order must be updated when an image is moved.</p>
  
  <p>Example: I have five images:</p>
  
  <pre><code>&lt;ul id="sortable"&gt;
    &lt;li id="1" value="1"&gt;image 1&lt;/li&gt;
    &lt;li id="2" value="2"&gt;image 2&lt;/li&gt;
    &lt;li id="3" value="3"&gt;image 3&lt;/li&gt;
    &lt;li id="4" value="4"&gt;image 4&lt;/li&gt;
    &lt;li id="5" value="5"&gt;image 5&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>If I move the image 4 after image 5, the order values ​​should not be changed. That is, the image 5 has the value 4 and the image 4 has the value 5.</p>
  
  <p>This is possible?</p>