How Do I Check If An Image Failed To Load Or Is Blank?

Hello,
I’m trying to create a random image generator and some images return as “Error 403: Asset is not approved for the requester”. I tried searching DevForums and ScriptingHelpers for an answer which none were compatible to my situation.

The Script:
Success = false

while Success == false do
	pcall(function()
		id = math.random(1,2000000000)
		if game.MarketplaceService:GetProductInfo(id).AssetTypeId==1 then
			Success = true
		end
	end)
	if Success then
		script.Parent.Image = "rbxassetid://"..id
	end
end

Try using LogService and then check the error that contains an Image asset ID, and then do a custom error that “image cannot be loaded”.