honor the w and h parameters when publishing

this is a shameless plug just to have this fixed quickly, publish.js is long overdue for a rewrite and I might just do it. for now @shamansir please take a look and merge if you don't see anything outstanding