Started code optimization

Added a resource holder class so that each image only needs to be
loaded once. Changed an if/else block to a switch statement.