Revert "Improve compareScreenshots function"

This reverts commit 0bf994d46ce2da2f457fe791c8d6d215dc16e0f1.