You can use this plugin. Copy and paste this code in a file inside the _plugins directory at the root of your Jekyll project.
https://gist.github.com/jgatjens/8925165
Then to use it just add the lines below
{% loop_directory directory:images iterator:image filter:*.jpg sort:descending %}
<img src="https://stackoverflow.com/questions/17446472/{{ image }}" />
{% endloop_directory %}