Fix canvas centering and resize handling