Strange. Your code works for me:
Code:
#!/bin/sh
image="test test";
echo "$image" | grep -q " ";
if [[ $? -eq 0 ]]
then
echo "found";
fi
As well as this:
Code:
#!/bin/sh
image="test test";
case $image in
*' '*) echo "found space" ;;
*) echo "not found" ;;
esac