Correctly sort images by name