add image resources and remove some extraneous code