Improved the way capInsets files are found

When deploying on a device, Xcode does not remove old resources. Thus,
you may have added a file named 'foo{4,0,4,0}.png' and then fixed it to
'foo{4,2,4,2}.png'.
Unfortunately, this method only looks for the first item named
'foo{x,x,x,x}.png' and returns it.
The only trick I found is to check the modification date and take the
earlier date.
I however have optimized the loop in order to break at the right moment.