Simpler template scaling, better aspect ratio determination