I have the following main.xml file with a LinearLayout
Add an ImageView into the xml, and if its not being used, make it invisible (image.setVisibility(View.INVISIBLE)). It may not show anything anyway when no image is set.
(image.setVisibility(View.INVISIBLE))