core: Fix screenshot function