Updating the script to match the latest URL format and accept the arguments for width and height