added other image extensions
refactor