It was quite easy to handle this problem once I found this wonderful article:
https://developers.facebook.com/docs/howtos/hideflashcallback/

The most important part is following:


function onFlashHide(info) {
if(info.state == 'opened') {
displayFlashScreenshot();
} else {
hideFlashScreenshot();
}
}

FB.init({
appId : 'APP_ID',
hideFlashCallback : onFlashHide
});

You can use any static image instead of the screenshot if you want a simple solution.