Use the imagesize library instead of gm identify to determine image dimensions
0.9.0