Make sorting work properly and deterministic
Make sorting work properly and deterministic

This fixes an issue where images uploaded within the same second ended up
with the same sort order, and the next/prev buttons were borked until the
user saved the layout. By using the image id as the tiebreaker, we should
get a stable sort, and by excluding our own image id we should be able to
request any images that were uploaded within the same second as well.

matslindh/kimochi,matslindh/kimochi