fix media manager for php 5.4