page border drawing fix, flip/mirror bugfixes