Added more error checking in rcube_image::resize()