Fixed crash for when img directory is not found