Fixed crash when attempting to export as image