It seems that the problem happens when a file name is shorter than another, but all the characters are the same as the longer one (first characters).

<b>example:</b>

  *  and will cause the problem
  *  and will be ok
  *  and will have the same problem

So it's not really related with extension...