sql script and image