fix bash function to backup image