Added OpenGL Version check, updated image writing code to make it more efficient.