Changed structure of Image class to prevent locking images handle in Windows