Added better error logging around the data-uri funciton