There are actually many things, which could be improved in the code.
- In u8g_prepare, a font is set, which is replaced late by a different font. This will waste flash ROM space
- Try to reduce the number of commands inside the picture loop. For example, you could easily call u8g_prepare() from outside the loop
- Within drawPhotogateStatus() you call digitalRead and you calculate several strings. For speedup, this also should happen outside the picture loop. Of course you need to place the strings into global variables
- You could also move to u8g2, which offers a full buffer mode. If you have sufficient RAM, full buffer mode will be much faster. With full buffer mode you also do not need to implement suggestions 2 and 3.
- If your application allows this, you could replace the picture loop with a state machine. This is a little bit advanced and also may lead to visible artefacts
Oliver