Cleaned up UI_IMG.js

Did some (very little) cleaning up and attempted to fix a bug that occurs, if no URL state is valid and url ist not directing to an image file.