Simplify image pipeline code