Stabilize reftests

r? @metajack

These are all commits you've previously reviewed, but without the image_border change madness. We're seeing some intermittent reftest failures, so I'd like to separately land these.