Simplify and fix HTML and image processing with uplevels