Added a check to ensure the background image extension is png.