EMI: Implement screenshot thumbnails for savegames

This patch implements the display of the screenshot thumbnails for EMI:

- I did some refactoring in gfx_*.cpp and moved up some common functions
- savegame thumbnails are correctly stored when using tinygl, opengl and opengl shaders
- savegame thumbnails are correctly displayed in tinygl and opengl (with opengl shaders the display of the menus is not working correctly, so I couldn't test)
- old savegames are not compatible (but the lua code will display them with the title "BAD DATA" and they can't be loaded)

line break this one.