This function (and resize_url) is basically identical to the thumb equivalent with a search'n'replace for thumb->resize.