I would not have images being passed around as variables at all! Instead, make all your images globals, load them in setup, and then use conditional statements inside your pacman class to determine which way pacman is moving & use the appropriate image.
if( dx > 0 ){
image( pacRight, pacX, pacY );
} else if ( dx < 0 ){
image( pacLeft, pacX, pacY );
} else // ... etc