image: Prevent insertion of endless spaces.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>