I will post if ready, the scripts are still too ugly to look at. And now even I need a bit of rest because I'm beginning to hallucinate and to believe I should have written everything in C firmware on that photo frame (C would have been more high level, it even has arrays. Bourne shell's eval is evil)
I'm sure awk and plotutils like cls said is the most pragmatic way to solve this task. Perhaps someone else wants to give this a try?