fixing screenshot frame size algorithm