Instead running a loop just assign the first value in the array after you did the split.
To get the first value from the "ImageFileName", you can do something like following-
string imgfilename= ImageFileName1.Split(',')[0];
If you are suspecting of possible empty entries or a comma in the start of the string, you can make use of
StringSplitOption[
^] to prevent such values as result.
string imgfilename= ImageFileName1.Split(',',StringSplitOptions.RemoveEmptyEntries)[0];
Hope, it helps.
Please let me know in case you need further help on this.
Thanks :)