add centering methods and fix compile error in CLCGImageView