Added support for non-jpg images