Moved url check to own function
Removed some unneeded vars
Check, if asset exists