modify upload image function, use gm size to crop