simplify image load logic