削るとかよりも素直に
WIDTH=`identify -format '%w' image.jpg`
HEIGHT=`identify -format '%h' image.ipg`
じゃない?