used QMainWindow instead of QWidget and removed the requirement of QHboxLayout and made public variables protected made common function of supported image formats.
refactored image list passed of only supported image formats