Improved and fixed the EGL context creation

- add missing eglCheck (EGL error macro)
- usage of the shared context
- intialize and terminate the EGL display properly
Fixed a header inclusion conflict
Fixed copy texture to image method