Refactored dataURI so that it can also be used on regular JSF resources.