Error thrown

Call to undefined method WP_Error::resize()