Input example:
foobar_1-1 1024 x 1024
Desired output
foobar_1-1
The hyphen is causing issues here. It's causing the output to be two items in the array:
foobar_1, 1
Any advice?
sed by default doesn't do that, it's a problem in your sed command.
if you want to manipulate strings like your example you can also use awk:
$ echo 'foobar_1-1 1024 x 1024' | awk -- '{ print $1 }'
foobar_1-1