Does it help if you simply add the following to the end of the /includes/modules/media_manager.php file? (before the closing ?> line)
Code:
$zv_product_has_media = (sizeof($za_media_manager)) > 0 ? TRUE : FALSE;
This should help prevent incorrect display in cases where incorrect cleanup has occurred.

The following post contains a code fix to prevent incorrect cleanup ...