Fixed cron script bug: inserting wrong media document