Bash script to turn images into strings