add external 2.1 detection and fix gd_compat for 2.1+